Ap K. File Status [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Language Reference for the Series 700 and 800
Appendix K File Status
ANSI File Status Summary
See the chapter File Input and Output and your COBOL System Reference for
more details.
ANSI'74 File Status Codes
Status Status Description
key 1 key 2
0 0 Successful completion
2 Indexed files only. One of two possibilities:
a. For a READ statement, the key value for the
current key is equal to the value of that
same key in the next record within the
current key of reference.
b. For a WRITE or REWRITE statement, the record
just written created a duplicate key value
for at least one alternate record key for
which duplicates are allowed.
1 0 There is no next logical record. This means that
you have reached the end of the file.
Status Status Description
key 1 key 2
2 1 For sequentially accessed files only: indicates a
sequence error. The ascending key requirement of
successive record key values has been violated, or,
the prime record key value has been changed by a
COBOL program between successful execution of a
READ statement and the execution of the next
REWRITE statement for that file.
2 2 Relative and indexed files only: indicates a
duplicate key value. An attempt has been made to
write or rewrite a record that would create a
duplicate key in a relative or indexed file.
3 Indicates no record found. An attempt has been
made to access a record, indentified by a key, and
that record does not exist in the file.
3 0 The input-output statement was unsuccessfully
executed as the result of a boundary violation for
a sequential file or as the result of an
input-output error, such as a data check parity
error, or a transmission error.
4 The input-output statement failed because of a
boundary violation. This condition indicates that
an attempt has been made to write beyond the
externally define d boundaries of a sequential
file.
9 Extended file Status Code
ANSI'85 File Status Codes
ANSI'85 file status codes include all ANSI'74 together with the following
status codes:
Status Status Description
key 1 key 2
0 4 The length of the record being processed does not
conform to the fixed file attributes for that file.
5 The referenced optional file is not present at the
time the OPEN statement is executed.
7 Sequential files only. For a CLOSE statement with
the REEL/UNIT phrase the referenced file is a
non-reel/unit medium.
1 4 Relative files only. The number of significant
digits in the relative record number is larger than
the size of the relative key data item described
for that file.
2 2 For indexed and relative files only, indicates a
duplicate key condition. An attempt has been made
to store a record that would create: a duplicate
key in the indexed or relative file or a duplicate
alternate record key for a file that does not allow
duplicates.
3 The conditions listed under ANSI'74 code "23". In
addition,, a START or READ statement has been
attempted on an optional input file that is not
present
4 Relative and indexed files only: Indicates a
boundary violation arising from one of the
following conditions:
a. An atttempt has been made to write beyond
the externally defined boundaries of a file.
b. A sequential WRITE statement is attempted
for a relative file,, but the number of
significant digits in the relative record
number is larger than the size of the
relative key data item described for the
file.
Status Status Description
key 1 key 2
3 5 An OPEN statement with the I-O, INPUT, or EXTEND
phrases has been attempted on a nonOPTIONAL file
that is not present.
7 An OPEN statement has been attempted on a file
which does not support the open mode specified in
the OPEN statement.
8 An OPEN statement has been attempted on a file
previously closed with a lock.
9 A conflict has been detected between the fixed file
attributes specified for that file in the program.
4 1 An OPEN has been attempted on a file already
opened.
2 A CLOSE has been attempted on a file already
closed.
3 Files in sequential access mode: the last I-O
statement executed for the file, prior to the
execution of a DELETE or REWRITE statement,, was
not a READ statement.
4 A boundary violation exists.
6 A sequantial READ statement has been attempted on a
file open in the INPUT or I-O mode but no valid
next record has been established.
7 A READ or START statement has been attempted on a
file not opened INPUT or I-O.
8 A WRITE statement has been attempted: on a file
not opended in the OUTPUT, I-O or EXTEND mode; or
on a file open I-O in the sequential access mode.
9 A DELETE or REWRITE statement has been attempted on
a file that is not opened I-O.
MPE/iX 5.0 Documentation