COBOL file status

File status 96: No DD statement for the file

File status 96 means there's no DD statement for the file being opened. For VSAM it applies to OPEN OUTPUT, and to OPEN I-O or EXTEND of an OPTIONAL file. For QSAM it applies when the CBLQDA(OFF) runtime option is in effect.

Other names for this code

Also written as FS 96, file status code 96, COBOL status 96, VSAM status 96, missing DD COBOL, status key 96, SK96.

What it means

Status 96 is an implementor-defined error from OPEN. The runtime found no allocation for the file's ddname, which comes from the ASSIGN clause of the SELECT statement.

The open mode decides whether a missing DD gives 96 or something else. For OPEN INPUT, or I-O and EXTEND of a required file, a missing DD is just one way of the file being unavailable, so the result is 35. Status 96 covers the cases where COBOL would otherwise create the file. For VSAM that means OPEN OUTPUT, or OPEN I-O or EXTEND of an OPTIONAL file. COBOL can't create a VSAM cluster without a definition and an allocation, so the OPEN fails.

For QSAM, the Language Environment runtime option CBLQDA decides. With CBLQDA(ON), an OPEN OUTPUT with no DD dynamically allocates a temporary data set and works. The program runs normally, and what it writes is lost when the temporary data set goes away. With CBLQDA(OFF) the same OPEN fails with 96. Status 98 is the related code when dynamic allocation through an environment variable named in the ASSIGN clause fails.

Common causes

  • The DD statement for an output file is missing from the step.
  • The ddname in the JCL doesn't match the ASSIGN name in the program.
  • A procedure override meant to add the DD went to the wrong step.
  • The program runs under TSO, ISPF or a test tool where the file wasn't allocated.

How to find the problem

  1. Take the ddname from the ASSIGN clause and search the step's JESJCL listing and allocation messages for it.
  2. For a VSAM file, check with IDCAMS LISTCAT that the cluster exists. It has to be defined before it can be allocated.
  3. If QSAM output sometimes disappears and sometimes gets 96, check the CBLQDA setting in the runtime options report. Running with RPTOPTS(ON) prints it.

How to fix it

  • Add the DD statement with the right ddname.
  • For a new VSAM file, define the cluster with IDCAMS DEFINE CLUSTER in an earlier step, then allocate it with a DD.
  • Run with CBLQDA(OFF), so a missing output DD fails clearly instead of writing to a temporary data set that disappears.

IBM documentation

IBM Enterprise COBOL documentation. Use the documentation for your installed release.

This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.

Report a correction to WND Software.

Questions

What is the difference between 96 and 35?

Both can mean a missing DD. 35 is for opens that need an existing file, such as INPUT. 96 is for opens that would create the file, such as VSAM OPEN OUTPUT.

Why did my program end normally but the output file is missing?

The DD was probably missing and CBLQDA(ON) was in effect. The runtime wrote the output to a temporary data set that was deleted at the end.