File status 34: Boundary violation on a sequential file
File status 34 means a WRITE to a sequential file went past the file's externally defined boundaries. In practice the data set ran out of space, the same condition that causes SB37, SD37 and SE37 abends.
Other names for this code
Also written as FS 34, file status code 34, COBOL status 34, status key 34, COBOL out of space, SK34.
What it means
Status 34 is a permanent error for sequential files. The WRITE failed because the file has no room left, and nothing more can be written to it.
For QSAM, the system finds the problem at end of volume, when the data set needs another extent and can't get one. If the file has no FILE STATUS clause and no error declarative, the step ends with a B37, D37 or E37 abend and the COBOL runtime issues IGZ0034W. If the file has a FILE STATUS clause, the runtime returns 34 to the program instead. The program then has to check it. IBM warns that a program that ignores the status may carry on, with results you won't expect.
For VSAM, the sequential organization is the ESDS. Running out of space on an ESDS comes from register 15 = 8 with feedback code 28 (X'1C'). On a KSDS or RRDS the same VSAM code becomes status 24.
Common causes
- The output data set's space is too small for the volume of data, often after business growth or an unusually large run.
- No secondary space was coded, so the data set can't grow past its primary allocation. This is the D37 case.
- The data set has used all the extents it's allowed, or no volume has room for more. These are the B37 and E37 cases.
- A program loop writes the same records again and again until space runs out.
How to find the problem
- Look in the job log for IEC030I (B37), IEC031I (D37) or IEC032I (E37). They name the ddname and the data set.
- DISPLAY the file status in the error path and log the number of records written when 34 appears.
- Compare that count with the normal volume. A count far beyond normal points to a loop.
- For a VSAM ESDS, display data-name-8 and run IDCAMS LISTCAT ALL to see the extents and HI-A-RBA.
How to fix it
- Give the data set more room. Increase the SPACE on the DD, use a larger secondary amount, or allow more volumes.
- Code BLOCK CONTAINS 0 RECORDS in the FD so the system picks an efficient block size for the device.
- Check the status after every WRITE. A program that ignores 34 can keep running and produce output that's missing records.
- Fix the loop if the record count is far too high.
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.
Related codes
Questions
Why didn't my job abend with B37?
Because the file has a FILE STATUS clause. The runtime returns 34 to the program instead of letting the step abend, and the program has to act on it.
What is the difference between file status 34 and 24?
34 is for sequential files, including QSAM and VSAM ESDS. 24 is the same kind of boundary violation on an indexed or relative file.
Does file status 34 apply to VSAM?
Yes, to an ESDS, which COBOL treats as a sequential file. A KSDS or RRDS reports running out of space as 24.