Mainframe Path Start learning free
CoreError and abend codesS013

S013 — dataset open failed

A dataset could not be opened, usually because its attributes conflict with the program or JCL, or a member does not exist.

What happened

The step abends with S013 at the point the program opens a file. An IEC141I message gives a reason code, the DD name and the dataset.

Typical JES messages (illustrative)
IEC141I 013-20,IGG0191B,ACCTJOB1,STEP010,INFILE,0A22,PRD045,
PROD.ACCT.INPUT
IEF450I ACCTJOB1 STEP010 - ABEND=S013 U0000 REASON=00000020

What it means

OPEN builds the file description from three sources: what the program declares, then the DD statement, then the dataset's own label. Values in the program win over the DD, and the DD wins over the label. If the merged result is impossible — or the member asked for is missing — OPEN fails with S013.

The reason code after 013 says exactly why. For example, 013-18 means a requested member was not found, and 013-20 means the block size is not a multiple of the record length for fixed-blocked records. Look up any other code in the z/OS system messages manual.

Typical causes

Symptoms

S013 happens at OPEN, before any records are read, which separates it from S0C7 or S0C4. If the COBOL program checks FILE STATUS, an attribute conflict may instead be reported as status 39 and the program decides what to do; with no check, Language Environment may end it with an IGZ message and U4038.

Where to look

How to diagnose

  1. Read the reason code and look it up.
  2. Find the DD and dataset named in the message.
  3. Compare program FD, DD DCB and actual dataset attributes side by side.
  4. For a member reason code, list the library and check the name.
  5. Check whether a recent change touched the file layout, the JCL or the dataset allocation.

How to fix

Make the three sources agree. Usually that means removing a wrong DCB from the DD, correcting the FD, or recreating the dataset with the right attributes. Coding BLOCK CONTAINS 0 in COBOL lets the system use the dataset's block size. Because S013 happens at OPEN, rerunning the failed step after the fix is normally safe, but check whether output files from the failing attempt need deleting.

How to prevent

Production considerations

Interview question

A job that ran fine last week now abends S013-20 on an input file. What happened?

Stuck on something else?
Ask the community or search the full course.

Ask a question