File Status Codes
COBOL-IT produces the same file status codes for VBISAM, CISAM, DISAM, and BerkeleyDB indexed files. For information on how to map COBOL-IT file status codes to custom file status codes, see the fstatus-map compiler flag. The -fstatus-map
compiler flag may be repeated as many times as necessary for cases where more than one file status code needs to be re-mapped.
Code | Description |
---|---|
00 | Success The file operation was successfully executed. |
02 | Success - Duplicate The file allows duplicate keys and a duplicate key has been detected on a READ NEXT operation; or has been created on a WRITE or REWRITE operation.( READ , WRITE , REWRITE ) |
04 | Success- Incomplete In a record sequential file with fixed record size, the READ of the last record returns fewer bytes than requested.( READ ) |
05 | Success- Optional The SELECT statement for the file contains the OPTIONAL phrase and the file does not exist, but the operation being executed does not require the existence of the file.( OPEN , DELETE ) |
07 | Success- No Unit A CLOSE UNIT WITH NO REWIND or CLOSE UNIT REMOVAL statement detected the absence of a UNIT , but does not require it.( CLOSE ) |
10 | End of file. A READ NEXT or READ PREVIOUS statement has detected the end (or beginning) of the file.( READ ) |
14 | Out of KeyRange A READ operation on a relative file failed when the key number was larger than permitted by the definition of the relative key data item.( READ ) |
21 | Invalid Key A WRITE operation on a relative file failed when the key number was inconsistent with the definition of the relative key data item. A DELETE , or READ on key operation failed because the record did not exist. A REWRITE operation failed because the key was changed.( WRITE , DELETE , READ , REWRITE ) |
22 | If the environment variable COB_KEY_DUP_ALWAYS_22 is set to “Y”:Key Exists/Duplicate Key The File does not allow duplicate keys and a duplicate key has been detected as the result of a WRITE or REWRITE operation.( WRITE , REWRITE ) |
23 | Record not found A READ on key, REWRITE , DELETE , or READ NEXT after START failed because the record was not found.( READ , REWRITE , DELETE ) |
30 | Permanent Error An error at the level of the operating system has occurred. |
35 | File Not Found ( OPEN , SORT ) |
37 | Permission Denied The OPEN statement being executed is not permitted. The user may not have permissions on the system to create a file in a given directory, or the OPEN operation requested may be not permitted. A PRINT file for example, may not be OPEN 'ed INPUT .( OPEN ) |
38 | Closed with Lock An OPEN statement failed on a file that was CLOSE 'd with LOCK by the current run unit.( OPEN ) |
39 | Conflict Attribute An OPEN statement failed when a difference between the attributes of the file being OPEN 'ed and the file description was detected.( OPEN ) |
41 | File Already Open An OPEN statement failed because the file is already open.( OPEN ) |
42 | File Already Closed A CLOSE statement failed because the file is already closed.( CLOSE ) |
43 | Read not Done When ACCESS MODE is SEQUENTIAL , a REWRITE or DELETE statement failed because it was not preceded by a READ statement.( REWRITE , DELETE ) |
44 | Record overflow A READ operation on a variable size record or a LINE SEQUENTIAL file failed because the read record is greater than the declared Record. A WRITE operation fail because the value of the field of the clause SIZE DEPENDING ON is smaller than the minimum record size or greater than the maximum size of a REWRITE operation fail. When ACCESS MODE is SEQUENTIAL because the new record size is different from the original record size. |
46 | Read Error A READ NEXT /PREVIOUS statement failed because there is no file pointer of reference.( READ ) |
47 | Input Denied An input file operation failed either because the file was not open, or not open in the mode required. ( READ , START ) |
48 | Output Denied An output file operation failed either because the file was not open, or not open in the mode required. ( WRITE ) |
49 | I_O Denied An IO file operation failed either because the file was not open, or not open in the mode required. ( REWRITE , DELETE ) |
51 | Record Locked A READ operation failed because the record is locked by another process.( READ ) |
52 | EOP A WRITE operation on a PRINT file failed after End-of-Page.( WRITE ) |
57 | I_O Linage An OPEN operation failed because the LINAGE description was incorrect.( OPEN ) |
61 | File Sharing An OPEN operation failed because the file was locked by another process.( OPEN ) |
91 | Not Available The operation requested is not available for the file. Returned when operations that are specific to indexed files are executed on record/line sequential files. ( START , READ on key, REWRITE , DELETE ) |