COBOL File Status Codes
COBOL File Status Codes
*****************
High- Low-
Order Order
Digit Meaning Digit Meaning
4 Logic Error 1 An OPEN statement was attempted for a file in the open
Condition mode.
2 A CLOSE statement was attempted for a file not in the
open mode.
3 For a mass storage file in the sequential access mode, the
last input-output statement executed for the associated
file prior to the execution of a REWRITE statement was
not a successfully executed for the associated file prior
to the execution of a REWRITE statement was not a
successfully executed READ statement.
For relative and indexed files in the sequential access
mode, the last input-output statement executed for the
file prior to the execution of a DELETE or REWRITE
statement was not a successfully executed READ
statement.
A boundary violation exists because an attempt was
4 made to rewrite a record to file and the record was not
the same size as the record being replaced, or an attempt
was made to write or rewrite a record that was larger
than the largest or smaller than the smallest record
allowed by the RECORD IS VARYING clause of the
associated file-name.
A sequential READ statement was attempted on a file
open in the input or I-O more and no validation next
6 record had been established because: 1) The preceding
READ statement was unsuccessful but did not cause an
at end condition; 2) The preceding statement caused an
at end condition.
The execution of a READ statement was attempted on a
file not open in the input or I-O mode.
The execution of a WRITE statement was attempted on a
7 file not open in the I-O , output, or extend mode.
The execution of a DELETE or REWIRTE statement
was attempted on a file not open in the I-O mode.
8
9
COBOL Functions
Calendar Functions
Financial Function.
Trigonometric Functions
Others
1. Upper -Case - Converts into Upper Case of given string
2. Lower -Case - Reverse of previous function
3. Length - Returns the length of the given string
4. Ord - Returns the ASCII value of a Character
5. Char - Returns the Character value of an ASCII value
6. Reverse - Reverses the given string