Hi, Garry Back again, please have a look at the coding below and see if my list of errors are correct......
WORKING STORAGE SECTION
01 W-TABLE PIC 9(4).
03 W-TABLE-ITEM OCCURS 100.
01 W-INDEX PIC 999.
PROCEDURE DIVISION.
PERFORM VARYING W-INDEX FROM 1 BY 1
UNTIL BAD-CODE OR W-INDEX > 100
IF IN-CODE = W-TABLE (W-INDEX) THEN
MOVE 'T' TO OUT-TYPE
DISPLAY W-INDEX (3)
DISPLAY W-TABLE-ITEM (200)
END-IF
END-PERFORM.
OPEN OUTPUT TEMP-FILE
SORT TEMP-FILE ON KEY T-VALUE
USING IN-FILE GIVING SORTED-FILE
MERGE TEMP-FILE ON KEY T-VALUE USING F-1 F-2.
CALL PROGRAM-2 USING W-TABLE W-INDEX
IF ERROR-1 OR ERROR-2 = "Y" THEN
PERFORM PRINT-ROUTINE
MOVE ALL ZERO TO W-INDEX
The errors I have spotted are as follows:-
1. Line 2 W-TABLE must not have a picture value as it refers to the whole table.
2 Line 3 I think a picture declaration should follow W-TABLE-ITEM otherwise the elements would have no fixed size.
3. Line 4 I am not sure if W-INDEX is defined properly, should it be a level 1 item??
4. Line 8 If W-INDEX is a subscript then can it be used as other than a subscript.
5. Line 12. Cannot display W-TABLE-ITEM (200) as it would be out of range...
Apparantly there are ten errors but I can only pick out the above......
WORKING STORAGE SECTION
01 W-TABLE PIC 9(4).
03 W-TABLE-ITEM OCCURS 100.
01 W-INDEX PIC 999.
PROCEDURE DIVISION.
PERFORM VARYING W-INDEX FROM 1 BY 1
UNTIL BAD-CODE OR W-INDEX > 100
IF IN-CODE = W-TABLE (W-INDEX) THEN
MOVE 'T' TO OUT-TYPE
DISPLAY W-INDEX (3)
DISPLAY W-TABLE-ITEM (200)
END-IF
END-PERFORM.
OPEN OUTPUT TEMP-FILE
SORT TEMP-FILE ON KEY T-VALUE
USING IN-FILE GIVING SORTED-FILE
MERGE TEMP-FILE ON KEY T-VALUE USING F-1 F-2.
CALL PROGRAM-2 USING W-TABLE W-INDEX
IF ERROR-1 OR ERROR-2 = "Y" THEN
PERFORM PRINT-ROUTINE
MOVE ALL ZERO TO W-INDEX
The errors I have spotted are as follows:-
1. Line 2 W-TABLE must not have a picture value as it refers to the whole table.
2 Line 3 I think a picture declaration should follow W-TABLE-ITEM otherwise the elements would have no fixed size.
3. Line 4 I am not sure if W-INDEX is defined properly, should it be a level 1 item??
4. Line 8 If W-INDEX is a subscript then can it be used as other than a subscript.
5. Line 12. Cannot display W-TABLE-ITEM (200) as it would be out of range...
Apparantly there are ten errors but I can only pick out the above......