System abend

S813: Tape data set name doesn't match the label

An S813 abend means OPEN found that the data set name in a tape's header label doesn't match the name on the DD statement. The return code is 04, and message IEC149I shows both names, with the label's version after LBL=.

Other names for this code

Also written as 813, S813-04, 813-04, abend 813, system abend 813, IEC149I 813-04, IEC149I.

What it means

On a standard-labeled tape, each data set has a header label that holds its name. When a program opens a tape data set, OPEN positions the tape at the requested file and compares the name in that label with the name the job asked for, which comes from the DD statement. If they don't match, OPEN issues message IEC149I and ends the step with system completion code 813, return code 04.

The label has room for only 17 characters, so it holds the last 17 characters of the data set name. That's what appears after LBL= in the message. If LBL= shows a string of zeros, the tape most likely holds only a volume label and a dummy header, the way a newly initialized tape does. The file you asked for isn't on it.

IBM documents only return code 04 for this abend. The check protects you from reading or extending the wrong file. Jobs that bypass label processing with LABEL=(,BLP), or read unlabeled tapes, skip the check and lose that protection.

Common causes

  • The DD statement has the wrong DSNAME or the wrong VOL=SER. A hard-coded volume serial in a job that reads an uncataloged tape is the classic case.
  • The file sequence number in LABEL=(n) points at a different data set on a multi-file tape.
  • The tape was scratched and reused or reinitialized, so the data set you want is gone. On a virtual tape server, scratched data can stay readable for a grace period and then be replaced by a new label.
  • The first file you asked for doesn't exist on the tape, which holds only a volume label and a dummy header.
  • A program changed the JFCB before OPEN, using RDJFCB and OPEN TYPE=J, and the new name doesn't match the tape.

How to find the problem

  1. Find IEC149I in the job log. It has the form IEC149I 813-04,IFG0195H,jobname,stepname,ddname,dev,volser,dsname,LBL=labelname. Compare the data set name with the LBL= value.
  2. Look at the mount message (IEF233A) just before it to confirm which volume was mounted.
  3. Check the volume in your tape management system (DFSMSrmm, CA 1 or similar). It shows which data sets the volume holds, at which file numbers, and whether it was scratched.
  4. If you still aren't sure what's on the tape, ask the storage team to print its labels.

How to fix it

  • Correct the DSNAME, VOL=SER or file sequence number on the DD statement. If the data set is cataloged, drop VOL=SER and let the catalog supply the volume.
  • If the tape was scratched by mistake, stop it being reused and ask the storage team at once whether the data can be recovered. Once a new label has been written, it usually can't.
  • If the tape no longer holds the data, recreate the data set from its source.
  • Avoid hard-coded volume serials in production JCL. Catalog tape data sets and refer to them by name.

What it looks like

IEF233A M 0B41,PR4417,,PAYRUN01,STEP020,PROD.PAYROLL.WEEKLY
IEC149I 813-04,IFG0195H,PAYRUN01,STEP020,TAPEIN,0B41,PR4417,PROD.PAYROLL.WEEKLY,LBL=00000000000000000
IEA995I SYMPTOM DUMP OUTPUT
  SYSTEM COMPLETION CODE=813  REASON CODE=00000004
IEF450I PAYRUN01 STEP020 - ABEND=S813 U0000 REASON=00000004

IBM documentation

IBM z/OS: 813. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Why does LBL= show only part of my data set name?

Tape header labels have 17 characters for the name, so the system stores the last 17 characters of the data set name. The comparison uses those characters.

Can I get around S813 with BLP?

Bypass label processing skips the check, and with it the protection. It reads whatever is at that position on the tape, and most sites restrict it. Fix the DD statement instead.

Is S813 the same as S613?

No. S613 means OPEN couldn't read, write or reach the labels properly. S813 means it read them, but the name didn't match.