The MOD function returns the Integer remainder after dividing one number by another (the modulus).
Category
Mathematical
Syntax
MOD(data_element, variable_name | constant)
Parameters and Descriptions
Parameter | Description |
---|---|
data_element | A field/column within a source datastore or Cursor results. Data_element_1 is also referred to as the dividend. |
variable_name | constant | This parameter specifies a variable or constant, also referred to as the divisor, that will be divided into data_element to calculate a remainder. |
Example
Find the database partition number for a 10 partition database numbered 0-9 using the customer number CUST_NUM and map the result to the target field PARTITION_NUM. Assume that the CUST_NUM is 1234567.
PARTITION_NUM = MOD (CUST_NUM, 10)
Returns the value 7 and maps it to the target field.