Returns the remainder of the first argument divided by the second argument.
The schema is SYSIBM. (The SYSFUN version of this function continues to be available.)
MOD(x,y) = x-(x/y)*y
where x/y is
the truncated integer result of the division. The result only is negative when the first argument is negative.
The result can be null if either argument can be null or if neither argument is a decimal floating-point number and the dft_sqlmathwarn database configuration parameter is set to YES; the result is the null value when either argument is NULL.
If either argument is a special decimal floating-point value, the general arithmetic operation rules for decimal floating-point apply.
SELECT MOD(:M1, :M2)
FROM SYSIBM.SYSDUMMY1
The result is 1 with a
data type of INTEGER. SELECT MOD(:M1, :M2)
FROM SYSIBM.SYSDUMMY1
The result is 0.60 with
a data type of DECIMAL(3,2). SELECT MOD(:M1, :M2)
FROM SYSIBM.SYSDUMMY1
The result is 1.50 with
a data type of DECIMAL(4,2).