Numeric Functions

Numeric functions perform calculations on numeric values.

Usage Example: Use of ROUND
DEFINE DATASET CUSTOMERS_D
   ROWSOURCE CUSTOMERS;
   THIS[CUST_ID]=CUSTOMERS.CUST_ID;
   THIS[CUST_CREDIT_LIMIT] = ROUND(CUSTOMERS.CUST_CREDIT_LIMIT,2);
   PRIMARYKEY[CUST_ID];
END
Numeric functions include the following:
  • ABS'(' value_returned_expression ')': Returns the absolute value of the numeric input.

    Inputs: A numeric expression.

    Example: ABS(-123)

  • ROUND'(' value_returned_expression, number ')': Rounds the numeric input to the specified decimal places using HALF UP rounding. Default is 0.

    Inputs: A numeric expression and the number of decimal places.

    Example: ROUND(-123.1111,2)

  • SIGN'(' value_returned_expression ')': Returns -1.0, 0.0, or 1.0 if the input is negative, zero, or positive, respectively.

    Inputs: A numeric expression.

    Example: SIGN(-123)

  • CEIL'(' value_returned_expression ')': Returns the smallest integer greater than or equal to the input.

    Inputs: A numeric expression.

    Example: CEIL(123.1111)

  • EXP'(' value_returned_expression ')': Returns the exponential raised to the power of the numeric input.

    Inputs: A numeric expression.

    Example: EXP(2)

  • FLOOR'(' value_returned_expression ')': Returns the largest integer less than or equal to the input.

    Inputs: A numeric expression.

    Example: FLOOR(123.1111)

  • LN'(' value_returned_expression ')': Returns the natural logarithm of the numeric input.

    Inputs: A numeric expression.

    Example: LN(2)

  • LOG'(' base, value_returned_expression ')': Returns the logarithm of the input with the specified base.

    Inputs: A numeric base and a numeric expression.

    Example: LOG(2,4)

  • MOD'(' value_returned_expression, value_returned_expression ')': Returns the remainder after dividing the first input by the second.

    Inputs: Two numeric expressions.

    Example: MOD(9,5)

  • SQRT'(' value_returned_expression ')': Returns the square root of the numeric input.

    Inputs: A numeric expression.

    Example: SQRT(9)

  • SIN'(' value_returned_expression ')': Returns the sine of the numeric input (in radians).

    Inputs: A numeric expression.

    Example: SIN(1.5708)

  • COS'(' value_returned_expression ')': Returns the cosine of the numeric input (in radians).

    Inputs: A numeric expression.

    Example: COS(1.5708)

  • TAN'(' value_returned_expression ')': Returns the tangent of the numeric input (in radians).

    Inputs: A numeric expression.

    Example: TAN(1.5708)

  • POWER'(' value_returned_expression, value_returned_expression ')': Raises the first input to the power of the second input.

    Inputs: Two numeric expressions.

    Example: POWER(4,3)