
I had a scenario where I needed to determine the remainder value following a division operation for all the rows in a SQL Table. Rather than performing the calculation myself to determine the remainder there is a SQL scalar function that will return it for me, its name is MOD.
IBM's documentation for MOD states that it "divides the first argument by the second argument and returns the remainder". Its syntax is just:
MOD( < dividend value or variable > , < divisor value or variable > ) |
For example:
01 VALUES MOD(9, 2) |