Can someone tell me how to add the values of a repeated item in RPG,consider I have the same employee record repeatedly in File with his allowance data,i want to sum up his allowance,then what should I do in RPG?
Can someone tell me how to add the values of a repeated item in RPG,consider I have the same employee record repeatedly in File with his allowance data,i want to sum up his allowance,then what should I do in RPG?
if the file you are reading is Keyed by employee # or some such, you can load a "key". RPG400 looks like ....
Move *OFF *IN30
key SETLL Filename
*IN30 DOWEQ *OFF
KEY READE Filename *IN30
*IN30 *IFEQ *ON
"add your tot to a running accum"