0% found this document useful (0 votes)
12 views

Mainframe COBOL File Status Codes With IAM

This document provides descriptions of COBOL file status codes that can occur with IBM's Information Access Method (IAM). It lists common file status codes, from 0 indicating successful completion to codes like 10 for end of file, 22 for a duplicate key error, and 24 for insufficient disk space. Codes in the 30s and 40s typically indicate issues with opening, closing, reading from or writing to a file improperly. Higher codes like 90 and above often represent logical errors or problems with file attributes not matching the defined file.

Uploaded by

Nilesh Mohite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Mainframe COBOL File Status Codes With IAM

This document provides descriptions of COBOL file status codes that can occur with IBM's Information Access Method (IAM). It lists common file status codes, from 0 indicating successful completion to codes like 10 for end of file, 22 for a duplicate key error, and 24 for insufficient disk space. Codes in the 30s and 40s typically indicate issues with opening, closing, reading from or writing to a file improperly. Higher codes like 90 and above often represent logical errors or problems with file attributes not matching the defined file.

Uploaded by

Nilesh Mohite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COBOL File Status Codes with IAM

File Reason for File Status Code


Status
0 Successful completion of request.
2 Successful completion of request. There are additional base records with the same
alternate key.
4 Successful completion of request, however the record size does not match the fixed
length of the record as defined within the COBOL program.
10 End of file.
14 Relative Record Number given exceeds maximum for this file.
21 On sequential WRITES, the key is lower than the previously written key. Or, on
REWRITE of an existing record, the application program changed the key of the record.
22 A WRITE of a new record was attempted for a key that matches a record currently in
the file.
23 The requested record (key) was not found in the file.
24 Additional DASD space was required for this request, but it could not be obtained. For
Compatible format files, this indicates that the Independent Overflow area has been
filled. For Enhanced format files, either there was insufficient DASD space to expand
the file, or the file had reached the maximum extents allowed, which is 16 extents per
DASD volume. Generally, this error requires that the file be reorganized, possibly
requiring a DELETE and DEFINE to allocate more DASD space. For Enhanced Format
files, if the cause is insufficient DASD space, if some existing data sets can be deleted
from the DASD volume, it might be possible to subsequently retry the request.
34 The file is full. See description for file status code 24 above.
35 Improper OPEN of an empty (unloaded) file, such as open for input only.
37 Invalid mode for OPEN
39 This file status generally implies a mismatch between the defined IAM file attributes
and the record layout in the COBOL program. For example, possible causes are the
key length or offset from the file definition do not match the COBOL record layout.
Also, the defined maximum record length for the file is shorter than the maximum
possible length for variable length records. COBOL requires that the defined record
length be at least as long as the maximum theoretical record size, from the layout.
Refer to the IAM PSEUDOLRECL feature for circumventing this restriction.
41 An OPEN was requested for a file that had already been opened.
42 A CLOSE was issued for a file that was already closed.
43 A file update request (that is, REWRITE or DELETE) was issued without a prior READ for
UPDATE.
44 An incorrect record length was specified on the WRITE. Either the length was shorter
than the minimum, which is key length plus key offset, or the record was longer than
the defined maximum record size for the file.
46 A READ failed because the application had not successfully established a position in
the file, or a READ was attempted after the end of file had been reached.
47 A READ request was issued for a file that was not opened for input or I/O.
48 A WRITE request was issued for a file not opened for output or I/O (update).
49 A DELETE or REWRITE request was issued for a file that was not opened for I/O
(update).
90 Logical error. Possible IAM logical error code x’E1’.
COBOL File Status Codes with IAM
File Reason for File Status Code
Status
92 Logic error. The file attributes from the COBOL program, such as key length, relative
key position, or record length do not match the IAM file being accessed.
Note
The defined record length for the file must be at least as large as the largest possible
record length.
93 Record lock contention or exclusive control errors.
Also could be caused by insufficient virtual storage to process the request. Most likely,
the REGION parameter has to be increased for the job. Check the IAM output,
IAMPRINT, from a Listcat of the file to determine how much storage will be required to
open this file.
94 Not positioned for a sequential READ request.
95 Invalid or incomplete file information.
96 The DD statement is missing for this file.

You might also like