-1

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?

1 Answers1

0

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

      LEAVE

      ENDIF       

"add your tot to a running accum"

   ENDDO
Harley G.
  • 64
  • 6