File status 44: Record length not allowed on WRITE or REWRITE
File status 44 means a WRITE or REWRITE used a record length the file doesn't allow. Either a REWRITE tried to change the length of the record, or the record is outside the RECORD VARYING limits.
Other names for this code
Also written as FS 44, file status code 44, COBOL status 44, VSAM status 44, status key 44, REWRITE record length COBOL, SK44.
What it means
Status 44 is a logic error about record size. IBM sets it in two cases. A REWRITE supplies a record whose length differs from the record it replaces, on a file where the length can't change. Or a WRITE or REWRITE supplies a record larger than the maximum or smaller than the minimum allowed by the FD's RECORD IS VARYING clause.
For a QSAM file updated in place, a REWRITE must keep the exact length of the record read. The access method overwrites the record inside its block and can't make room. For VSAM, a KSDS or RRDS with variable-length records can take a new length on REWRITE, within the FD's limits, but an ESDS record can't change length. VSAM itself rejects a length it can't use with register 15 = 8 and feedback code 108 (X'6C'), and a length change during an addressed update with feedback code 100 (X'64').
Under the older CMPR2 behavior a QSAM length problem of this kind was reported as 00 and a VSAM one as 00 or 92, so old programs sometimes passed bad lengths without any error.
Common causes
- The DEPENDING ON item of a RECORD VARYING clause, or the OCCURS DEPENDING ON count that sets the record length, wasn't set, or was set wrongly, before the WRITE.
- A REWRITE of a variable-length QSAM record after changing a count field, which changes the record's length.
- A REWRITE that moves a different record layout, of a different length, into the record area of an ESDS or QSAM file.
- Input data with more occurrences than the copybook's maximum, so the built record is too long.
How to find the problem
- DISPLAY the record length, meaning the DEPENDING ON item or the length you compute, just before the failing WRITE or REWRITE.
- Compare it with the RECORD VARYING FROM and TO values in the FD, and for VSAM with MAXLRECL from IDCAMS LISTCAT ALL.
- For a REWRITE, compare the length with the length of the record the READ returned.
- Display data-name-8 for a VSAM file. Feedback 108 (X'6C') means VSAM rejected the length.
How to fix it
- Set the record length item before every WRITE, and before a REWRITE when the length may change.
- Keep the REWRITE length equal to the length read for QSAM and ESDS files. To change lengths, copy the file and write new records.
- Check occurrence counts against the copybook maximum before building the record.
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
Can I change a record's length with REWRITE?
On a VSAM KSDS or RRDS with variable-length records, yes, within the FD's limits. On a QSAM file or an ESDS, no. The new record must be the same length as the old one.
What is the difference between 44 and 04?
04 is a warning on READ when a record's length is outside the FD's range. 44 is an error on WRITE or REWRITE, and the record isn't written.