Problem:
I/O error : file 'AS1S'
error code: 9/220 (ANS74), pc=0, call=1, seg=0
220 Attempt to execute more than one SORT or MERGE simultaneously
The problem is input procedure is working fine and is releasing all records, but while returning the records it is abending and is throwing the error as mentioned above.
What could be the reason for this, since no other sort or merge statements are being executed?
006200 PROCESS-RECORDS.
006400 SORT AS1S-SORT-FILE
006500 ON ASCENDING KEY AS1S-SD-NO
006600 INPUT PROCEDURE IS 3100-INPUT-PROCEDURE
006700 OUTPUT PROCEDURE IS 3200-OUTPUT-PROCEDURE.
<snip>
007700 3100-INPUT-PROCEDURE SECTION.
007800*
007900 MOVE 100 TO AS1S-SD-NO.
008000 RELEASE AS1S-SORT-RECORD.
008100 MOVE 700 TO AS1S-SD-NO.
008200 RELEASE AS1S-SORT-RECORD.
008300 MOVE 500 TO AS1S-SD-NO.
008400 RELEASE AS1S-SORT-RECORD.
008600 INPUT-PROC-EXIT.
008700 EXIT.
008800*
008900 3200-OUTPUT-PROCEDURE.
009100 RETURN AS1S-SORT-FILE RECORD INTO SORT-RECORD
009200 AT END GO TO 3299-OP-EXIT.
009300*
009400 display 'AS1S-RECORD is:' SORT-RECORD.
009500 MOVE 'ST07' TO WS-ABEND-LOCATION.
009600*
009700 GO TO 3200-OUTPUT-PROCEDURE.
Resolution:
The problem is that the output-procedure section does not have the word section in the title, so the program is treating it as another paragraph in the input procedure! If you add section after 3200-output-procedure, the program compiles and runs correctly.
#ServerExpress
#AcuCobol
#RMCOBOL
#COBOL
#netexpress