The following code works for me. Add it to an SQL RPGLE program. What the SQL RAND() does is generate a random decimal value less than 1. Multiplying it times 100 into an integer variable results in a value from 1 to 100 after rounding. The dummy FROM clause is entered as written below.
This can work with any range of numbers. Say you want a value 1 to 250. Just change the * 100 to * 250.
D Random S 5I 0 Inz
C+ Select Rand() * 100 Into :Random
C+ From SYSIBM/SYSDUMMY1