Thread: CICS

STARTBR / READNEXT - how do I know I hit end of file?

Started by Jordan • user3 replies169 viewsLast activity 1 week ago
Post #1
0 votes
Jordan
Reputation
12
Posts: 32
Joined: May 2, 2026, 11:10 AM
Posted: Aug 3, 2026, 1:25 PM

Need to walk a whole VSAM file under CICS. Doing READNEXT in a loop. How do people detect end? Is there an END-OF-FILE flag or do I watch RESP?

Post #2
1 votes
Dave
Reputation
356
Posts: 25
Joined: Jul 21, 2024, 2:55 PM
Posted: Aug 3, 2026, 3:25 PM

STARTBR, then READNEXT until RESP = ENDFILE (or DFHRESP(ENDFILE)), then ENDBR.

Do not guess from key values. Check RESP every time.

Post #3
0 votes
Anita
Reputation
118
Posts: 23
Joined: May 29, 2025, 12:45 PM
Posted: Aug 3, 2026, 7:25 PM

And put RESP2 on the commands when you get INVREQ. RESP 16 alone is not enough detail.

You must be signed in to reply to this thread