File status 24: Boundary violation on an indexed or relative file
File status 24 means a WRITE tried to go beyond the externally defined boundaries of an indexed or relative file. On a VSAM KSDS or RRDS it most often means the data set ran out of space.
Other names for this code
Also written as FS 24, file status code 24, COBOL status 24, VSAM status 24, VSAM out of space COBOL, status key 24, SK24.
What it means
Status 24 is an invalid key condition for indexed and relative files, and the record was not written. IBM describes it as an attempt to write past the file's externally defined boundaries.
In practice there are two kinds. The common one is space. A KSDS or RRDS has filled its allocation and VSAM can't get another extent, for example because the volume is full or the data set has used all the extents it may have. VSAM reports this as register 15 = 8 with feedback code 28 (X'1C'), the data set can't be extended. The other kind is a relative record number that's too large. On a sequential WRITE to a relative file, IBM sets 24 when the number has more digits than the RELATIVE KEY item can hold.
QSAM and line-sequential files never return 24. The same out-of-space condition on a sequential file is status 34. An ESDS is a sequential file to COBOL, so check 34 for it as well.
Common causes
- The KSDS or RRDS has filled its primary and secondary space, or no secondary space was defined.
- No volume in the storage group has room for another extent.
- The data set has reached the maximum number of extents it's allowed.
- Heavy inserts caused many control interval and control area splits, which use space faster than the record count suggests.
- On Enterprise COBOL 5 and later, a defect fixed by APAR PI77291 returned 24 on WRITE (and 23 on READ) for an RRDS with a zoned relative key longer than 10 digits. If your relative key is that long, check the PTF is applied.
How to find the problem
- Display data-name-8. Return code 8 with feedback code 28 (X'1C') is the out-of-space case.
- Run IDCAMS LISTCAT ALL on the cluster. Compare HI-U-RBA (high used) with HI-A-RBA (high allocated), and look at EXTENTS, SPLITS-CI and SPLITS-CA.
- Check the job log and SYSLOG at the time of the failure for VSAM end-of-volume messages such as IEC070I.
- For a relative file, DISPLAY the relative key before the WRITE.
How to fix it
- Reorganize the cluster. Copy it out with IDCAMS REPRO, delete and redefine it with larger primary and secondary space, then REPRO the data back.
- If splits are high, review FREESPACE and the control interval size. Too little free space makes inserts split often.
- Ask your storage team about the storage group if no volume has room for new extents.
- For a relative file, make the RELATIVE KEY item large enough for the highest record number you'll use.
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
What is the difference between file status 24 and 34?
Both are boundary violations. 24 is for indexed and relative files such as a KSDS or RRDS. 34 is for sequential files, including QSAM and VSAM ESDS.
Will deleting records fix a 24?
Not reliably. Deleted records free space inside control intervals, but the cluster doesn't shrink or give space back. A reorganization is the dependable fix.
Why didn't my job abend with B37?
VSAM doesn't use the B37, D37 and E37 abends for running out of space. It returns a feedback code, and COBOL turns that into 24.