What it means
RESP 20 (RESP2 90) is raised by READNEXT when the browse runs off the end of the file. It is the normal way a browse loop finishes.
If the program does not test RESP for it, CICS ends the task abnormally.
Typical causes
- The browse loop read every record from the start key to the end of the file.
- The start key was past the last record, so the first READNEXT already hit the end.
- The loop has no other stop test, such as checking when the key prefix changes.
How to fix it
- Test RESP after every READNEXT and leave the loop on ENDFILE.
- Issue ENDBR after the loop finishes.
- Add a stop test on the key so the loop ends before the end of file when only a range is needed.
- If ENDFILE comes on the first read, check the start key.
Example
Illustrative only; names and values are invented.
PERFORM UNTIL WS-RESP = DFHRESP(ENDFILE)
EXEC CICS READNEXT FILE('ORDFILE') INTO(WS-ORD) RIDFLD(WS-KEY)
RESP(WS-RESP) END-EXEC
END-PERFORM