In this guide, we will explore the various number functions available in DataStage and learn how to use them effectively.
number1 + number2
This code adds two numbers together. For example:
5 + 3
This would return the result 8.
number1 - number2
This code subtracts one number from another. For example:
5 - 3
This would return the result 2.
number1 * number2
This code multiplies two numbers together. For example:
5 * 3
This would return the result 15.
number1 / number2
This code divides one number by another. For example:
5 / 3
This would return the result 1.6666666666667.
number1 % number2
This code calculates the remainder of dividing one number by another. For example:
7 % 3
This would return the result 1.
ABS(number)
This code returns the absolute value of a number. For example:
ABS(-5)
This would return the result 5.
CEILING(number)
This code rounds a number up to the nearest integer. For example:
CEILING(5.2)
This would return the result 6.
FLOOR(number)
This code rounds a number down to the nearest integer. For example:
FLOOR(5.2)
This would return the result 5.
TO_DOUBLE(number)
This code converts a numeric value to a double precision floating-point number. For example:
TO_DOUBLE(123)
This would return the result 123.0.
INT(number)
This code converts a numeric value to an integer. For example:
INT(123.456)
This would return the result 123.