This page is a discussion on the mentioned topic. Most of the answers are in their original posted form, including any technical/spelling/grammatical errors. No guarantees are expressed or implied. :-)
Comments, corrections, concerns about this tip?
I'm trying to do modulus 100 (x Mod 100 for VB folks, x % 100 for C
people) in a CL program. In RPG, I'd simply define a 2-position variable and then MOVER a larger number into it (or use MVR). CL bitches about the receiver variable being too small to hold the result (MCH1210). Is there no way around this? Do I have to do some cheesy division-then-multiplication-then-subtraction crap to achieve this result?
Answer(s):
Move the numeric value to a char variable and take the last two digits.