Thread: Abends and Error Codes

S0C4 after OPEN failed - we kept going anyway

Started by Rick • user3 replies171 viewsLast activity 1 month ago
Post #1
0 votes
Rick
Reputation
302
Posts: 22
Joined: Jun 14, 2024, 9:41 AM
Posted: Jul 16, 2026, 12:32 PM

Another one for the archives. OPEN failed (bad status), no check, later WRITE, S0C4. Dev swore the DISPLAY after OPEN proved the file was fine because an earlier test showed 35 and RC 0.

How do you get juniors to treat file-status like SQLCODE?

Post #2
0 votes
Marty
Reputation
412
Posts: 58
Joined: Aug 12, 2024, 9:14 AM
Posted: Jul 16, 2026, 2:32 PM

Shop standard: after every OPEN/READ/WRITE/START, evaluate status, non-ok goes to a common abend paragraph that dumps status + filename.

Code review rejects bare OPEN. Same energy as missing SQLCODE checks.

Post #3
1 votes
James
Reputation
524
Posts: 30
Joined: May 2, 2024, 8:00 AM
Posted: Jul 16, 2026, 7:32 PM

We added an excerpt from the file-status table to the onboarding doc. 35/37/39/96 show up in week one otherwise.

You must be signed in to reply to this thread