Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

I-O status

The I-O status is a value that can be used in a COBOL program to check the status of an input/output operation. In order to do this, the FILE STATUS clause must be specified in the FILE CONTROL paragraph of the ENVIRONMENT DIVISION.
The I-O status value is transferred to a two-character data item

  • during the execution of a CLOSE, OPEN, READ, REWRITE, or WRITE statement,

  • prior to the execution of any associated imperative statement, and

  • prior to the execution of any corresponding USE AFTER STANDARD EXCEPTION procedure.

The table below shows the I-O status values and their meanings:

I-O status

Meaning


Execution successful

00

The I-O statement terminated normally.
No further information regarding the I-O operation is available.

04

Record length conflict: A READ statement was executed successfully, but the length of the record which was read does not lie within the limits specified in the record description for the file.

Successful OPEN INPUT/I-O/EXTEND for a file with the OPTIONAL phrase in the SELECT clause that was not present at the time of execution of the OPEN statement.


Execution unsuccessful: at end condition

10

An attempt was made to execute a READ statement. However, no next logical record was available, since the end-of-file was encountered (sequential READ).

A first attempt was made to execute a READ statement for a non-existent file which is specified as OPTIONAL.

14

An attempt was made to execute a READ statement.
However, the data item described by RELATIVE KEY is too small to accommodate the relative record number. (sequential READ).


Execution unsuccessful: invalid key condition

22

Duplicate key
An attempt was made to execute a WRITE statement with a key for which there is already a record in the file.

23

Record not located or zero record key
An attempt was made (using a READ, START, DELETE or REWRITE statement with a key) to access a record not contained in the file, or the access was effected with a zero record key.

24

Boundary values exceeded (see "COBOL2000 User Guide" [1]).
An attempt was made to execute a WRITE statement beyond the system-defined boundaries of a relative file (insufficient secondary allocation in the FILE command), or a WRITE statement is attempted in sequential access mode with a relative record number so large that it does not fit in the data item defined with the RELATIVE KEY phrase.


Execution unsuccessful: permanent error

30

No further information regarding the I-O operation is available.

35

An attempt was made to execute an OPEN INPUT/I-O statement for a nonexistent file.

37

An OPEN statement is attempted on a file that cannot be opened due to the following conditions:

  1. OPEN OUTPUT/I-O/EXTEND on a write-protected file
    (password, RETPD in catalog, ACCESS=READ in catalog)

  2. OPEN INPUT on a read-protected file (password)

38

An attempt was made to execute an OPEN statement for a file previously closed with the LOCK phrase.

39

The OPEN statement was unsuccessful as a result of one of the following conditions:

  1. One or more of the operands ACCESS-METHOD, RECORD-FORMAT or RECORD-SIZE were specified in the ADD-FILE-LINK command with values which conflict with the corresponding explicit or implicit program specifications.

  2. The catalog entry of the FCBTYPE operand for an input file does not match the corresponding explicit or implicit program specification or the specification in the ADD-FILE-LINK command.

  3. Variable record length has been defined for a file that is to be processed using the UPAM access method of the DMS.


Execution unsuccessful: logical error

41

An attempt was made to execute an OPEN statement for a file which was already open.

42

An attempt was made to execute a CLOSE statement for a file which was not open.

43

For ACCESS MODE IS SEQUENTIAL:
The most recent I-O statement executed prior to a DELETE or REWRITE statement was not a successfully executed READ statement.

44

Record length limits exceeded:
An attempt was made to execute a WRITE or REWRITE statement, but the length of the record does not lie within the limits defined for the file.

46


An attempt was made to execute a sequential READ statement for a file in INPUT or I-O mode. However, there is no valid next record since:

  1. the preceding START statement terminated abnormally, or

  2. the preceding READ statement terminated abnormally without causing an at end condition.

  3. the preceding READ statement caused an AT END condition.

47

An attempt was made to execute a READ or START statement for a file not in INPUT or I-O mode.

48

An attempt was made to execute a WRITE statement for a file

  • not in OUTPUT or EXTEND mode (for sequential access)
  • not in OUTPUT or I-O mode (for random or dynamic access)

49

An attempt was made to execute a DELETE or REWRITE statement for a file not in I-O mode.


Other conditions with unsuccessful execution

90

System error; no further information regarding the cause is available.

91

System error; OPEN error

93

For simultaneous processing only (see "Shared updating of files" in the "COBOL2000 User Guide" [1]):
The I-O statement could not terminate normally because a different task is accessing the same file, and the access operations are incompatible.

94

For shared update processing only (see "Shared updating of files" in the "COBOL2000 User Guide" [1]):
deviation from call sequence READ - REWRITE/DELETE.

95

The specifications in the BLOCK-CONTROL-INFO or BUFFER-LENGTH operands of the ADD-FILE-LINK command are not consistent with the file format, the block length, or the format of the volume being used.

96

READ PREVIOUS is not supported for a module compiled with COBRUN ENABLE-UFS-ACCESS=YES or the file has to be processed with the DMS UPAM access method.