I have a task, where I have to write the different occurances of an array in an output file. I have written a loop to read through all occurances of array.
But my program is only displaying the first instance correctly, all other instances of array are appearing as spaces.
Please help me!!!!
Code: Select all
FILE INAUDIT
IN-ARRAY 1 1750 A
*-------------------------------------------
WS-ARRAY W 35 A OCCURS 50
WS-SUB2 W 2 N
*-------------------------------------------
JOB INPUT INAUDIT
MOVE IN-ARRAY TO WS-ARRAY
WS-SUB2 = 1
DO WHILE (WS-SUB2 LE 50)
DISPLAY WS-SUB2 ' :' WS-ARRAY (WS-SUB2)
WS-SUB2 = WS-SUB2 + 1
END-DO
GOTO JOB
Input Data:
S 525 : : : :2010022520100225 F 88I : : : :2009122820091228
Output:
1:S 525 : : : :2010022520100225
2:
3:
-
-
49:
50:
[/code]