After an input-output operation on an STL file, one of several error codes can occur.
FILE STATUS data-name-1 data-name-8
In the FILE-CONTROL paragraph, you can code the clause shown above for an STL file. After an input-output operation on the file, data-name-1 contains a status code that is independent of the file system used, and data-name-8 contains one of the STL file system return codes shown in the tables below.
| Code | Meaning | Notes |
|---|---|---|
| 0 | Successful completion | The input-output operation completed successfully. |
| 1 | Invalid operation | This return code should not occur; it indicates an error in the file system. |
| 2 | I/O error | A call to an operating system I/O routine returned an error code. |
| 3 | File not open | Attempt to perform an operation (other than OPEN) on a file that is not open |
| 4 | Key value not found | Attempt to read a record using a key that is not in the file |
| 5 | Duplicate key value | Attempt to use a key a second time for a key that does not allow duplicates |
| 6 | Invalid key number | This return code should not occur; it indicates an error in the file system. |
| 7 | Different key number | This return code should not occur; it indicates an error in the file system. |
| 8 | Invalid flag for the operation | This return code should not occur; it indicates an error in the file system. |
| 9 | End-of-file | End-of-file was detected. This is not an error. |
| 10 | I/O operation must be preceded by an I/O GET operation | The operation is looking for the current record, and the current record has not been defined. |
| 11 | Error return from get space routine | The operating system indicates that not enough memory is available. |
| 12 | Duplicate key accepted | The operation specified a key, and the key is a duplicate. |
| 13 | Sequential access and key sequence bad | Sequential access was specified, but the records are not in sequential order. |
| 14 | Record length < max key | The record length does not allow enough space for all of the keys. |
| 15 | Access to file denied | The operating system reported that it cannot access the file. Either the file does not exist or the user does not have the proper permission of the operating system to access the file. |
| 16 | File already exists | You attempted to open a new file, but the operating system reports that the file already exists. |
| 17 | (Reserved) | |
| 18 | File locked | Attempt to open a file that is already open in exclusive mode |
| 19 | File table full | The operating system reports that its file table is full. |
| 20 | Handle table full | The operating system reports that it cannot allocate any more file handles. |
| 21 | Title does not say STL | Files opened for reading by the STL file system must contain a header record that contains “STL” at a certain offset in the file. |
| 22 | Bad indexcount argument for create | This return code should not occur; it indicates an error in the file system. |
| 23 | Index or relative record > 64 KB | Index and relative records are limited to a length of 64 KB. |
| 24 | Error found in file header or data in open of existing file | STL files begin with a header. The header or its associated data has inconsistent values. |
| 25 | Indexed open on sequential file | Attempt to open a sequential file as an indexed or relative file |
The following table shows return codes for errors detected in the adapter open routines.
| Code | Meaning | Notes |
|---|---|---|
| 1000 | Sequential open on indexed or relative file | Attempt to open an indexed or relative file as a sequential file |
| 1001 | Relative open of indexed file | Attempt to open a relative file as an indexed file |
| 1002 | Indexed open of sequential file | Attempt to open an indexed file as a sequential file |
| 1003 | File does not exist | The operating system reports that the file does not exist. |
| 1004 | Number of keys differ | Attempt to open a file with a different number of keys |
| 1005 | Record lengths differ | Attempt to open a file with a different record length |
| 1006 | Record types differ | Attempt to open a file with a different record type |
| 1007 | Key position or length differs | Attempt to open a file with a different key position or length |
related tasks
Using file status keys
related references
STL file system
FILE STATUS clause
(COBOL for Windows Language Reference)