Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

ENDFILE

DFHRESP(ENDFILE) = 20CICS RESP CONDITION · CHECKED 2026-11-14
Checked against IBM documentation

The end of the file was reached during a browse, so there are no more records to read.

QUICK ANSWER

The end of the file was reached during a browse, so there are no more records to read.

LIKELY CAUSES, IN THE ORDER OF THIS ENTRY

  1. The browse has read to the end of the file.
  2. The program does not test for ENDFILE, so the default action applies.

CHECKED 14 Nov 2026 IBM: READNEXT (CICS Transaction Server for z/OS 6.x) · EXEC interface block (EIB) fields (CICS Transaction Server for z/OS 6.x)

MOST LIKELY

The browse has read to the end of the file.

FIRST CHECK

Test RESP after every READNEXT and leave the browse loop on ENDFILE.

TRY IT ▸

Site search

What it means

ENDFILE is RESP 20 with RESP2 90 on READNEXT. An end-of-file condition was detected during the browse.

The default action is to end the task abnormally.

Typical causes

  • The browse has read to the end of the file.
  • The program does not test for ENDFILE, so the default action applies.

How to fix it

  1. Test RESP after every READNEXT and leave the browse loop on ENDFILE.
  2. Code RESP so the task does not end abnormally.

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