COBOL file status codes with IAM
While the above error codes are available to COBOL programs, more frequently these programs use the COBOL File Status Codes for interpreting error situations. Below are the more frequently encountered File Status Codes which can occur while processing an IAM file.
File Status | Reason for File Status Code |
---|---|
00 | Successful completion of request. |
02 | Successful completion of request. There are additional base records with the same alternate key. |
04 | 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’. |
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. |
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. |