Thread: COBOL

File status 35 then 96 after I added a WRITE - what?

Started by Tyler • user3 replies223 viewsLast activity 2 weeks ago
Post #1
1 votes
Tyler
Reputation
34
Posts: 19
Joined: Nov 8, 2025, 1:44 PM
Posted: Jul 31, 2026, 9:14 AM

OPEN OUTPUT, no DD in the JCL. DISPLAY file-status showed 35, job RC 0.

Added a WRITE after the DISPLAY. Same OPEN, now DISPLAY shows 96 and we S0C4 on the WRITE.

Why did the status on OPEN change just because I added a WRITE later?

Post #2
0 votes
Rick
Reputation
302
Posts: 22
Joined: Jun 14, 2024, 9:41 AM
Posted: Jul 31, 2026, 11:14 AM

35 = file not present. 96 = no DD statement (VSAM/QSAM flavor depending on shop options / CBLQDA).

COBOL does not stop after a bad OPEN. Your DISPLAY is not a checkpoint of "what OPEN returned forever." By the time you WRITE with no DD, things are already sideways and status can look different.

Check status after OPEN and ABEND yourself on anything not 00/97. Add the missing DD.

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

Also look up CBLQDA for your runtime. It changes how missing DDs behave on QSAM.

You must be signed in to reply to this thread