S137: Tape end-of-volume error
An S137 abend means an error occurred during end-of-volume processing on a magnetic tape, while the system was writing or reading labels, or positioning the tape. Message IEC022I comes with it, and its return code tells you which step failed.
Other names for this code
Also written as 137, abend 137, system abend 137, S137 abend, IEC022I, IEC022I 137, S137-0C.
What it means
End-of-volume (EOV) processing runs when a tape data set reaches the end of a volume and must go on to the next one, or when the system reaches the end of the data on a volume. On output, EOV writes trailer labels and a tape mark, then handles the next volume and its labels. On input, it reads the trailer labels and positions the next volume. When any of these steps fails, DFSMSdfp ends the task with system completion code 137, unless a DCB ABEND exit chooses to ignore the error.
Message IEC022I gives the job, step, DD name, device, volume serial and data set name, and a return code. On output it can also report a number of lost blocks. Those are blocks the drive accepted into its buffer but never wrote to the tape. The return codes fall into three groups.
- I/O errors while writing a trailer label or tape mark (04), positioning for label processing or to the end of the data set (08, 10), reading trailer or header labels (0C, 14), positioning to the first record (18), or reading a block ID (38).
- Label content problems. The trailer label (1C) or header label (20) read during EOV was incorrect, the volume has an ISO/ANSI label version the system doesn't support (2C), or a label validation exit rejected the volume (30).
- Volume selection problems. A second or later output volume holds a data set that hasn't expired and the operator didn't reply U to let it be overwritten (24), the operator replied M to the IEC704A labeling request or it had to be asked too many times (28), or a private volume in an automated tape library was rejected (3C).
Common causes
- A worn or damaged tape, or a drive that needs cleaning or repair. These show up as the I/O return codes.
- A volume with wrong or damaged labels, for example a tape that was written by another system or partly overwritten.
- A second or later output volume that still holds a data set whose expiration date hasn't passed.
- A volume whose labels don't meet the standard the system expects, such as an unsupported ISO/ANSI label version.
- An operator reply that rejected the volume, or a tape management or validation exit that refused it.
How to find the problem
- Find IEC022I in the job log or the system log. Note the return code after
137-, the device number, the volume serial and the data set name. - For I/O return codes, look in the system log for I/O error messages on the same device at the same time, and check whether other jobs had errors on that drive or volume.
- For label return codes, print the labels of the volume with a tape utility to see what is really there. For return code 30, message IEC512I names the label field in error.
- Check your tape management system for the volume's status, expiration date and history.
How to fix it
- For I/O errors, try another tape first (a new scratch request gets one), and if the error follows you, change the UNIT parameter to get a different drive.
- For an unexpired data set on a requested volume (24), name a different volume, or have the operator reply U if overwriting it is really intended.
- For an unsupported ISO/ANSI label version (2C), relabel the volume with IEHINITT before using it again.
- For label content errors, examine the volume and correct or relabel it before trying to read the data again.
- If the problem recurs on good volumes and drives, collect the job output and contact IBM or the tape vendor.
IBM documentation
IBM z/OS: 137. Use the documentation for your installed release.
Related codes
Questions
Is S137 always a hardware problem?
No. IBM describes it as usually a user error unless an I/O error occurred. Several return codes point to labels, expiration dates or operator replies rather than the hardware.
What does LOST BLOCKS mean in IEC022I?
It is the number of blocks the drive accepted into its buffer but didn't write to the tape before the error. The output on that volume is incomplete, so rerun the step.
Should I retry on the same tape and drive?
For an I/O error, try a different volume first, then a different drive. Retrying on the same pair usually fails the same way.