COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
The I-O status codes that result from an unsuccessful write operation are:
Unsuccessful Write OperationI-O Status Code
The file is defined to have indexed organization and sequential access mode, and the
prime record key value of the logical record is less than or equal to the prime record key
value of the most recently released record.
“21”
One of:“22”
◦ The relative record number to be associated with the logical record equals that of a
record that already exists in the file (random access or dynamic access only).
◦ The prime record key value of the logical record equals that of a record that already
exists in the file (random access or dynamic access only).
◦ An alternate record key value of the logical record equals that of a record that already
exists in the file and duplicate values are not allowed for that key all access modes.
A boundary violation exception exists when execution of a WRITE statement would require
exceeding the record storage capacity of the file. The logical record is not released.
“24”
The write operation failed due to non-COBOL causes. The specified record might or might
not have been written.
“30”
When the file is described with the RECORD VARYING clause, the logical record size must
be neither greater than the maximum nor less than the minimum number of character
“44”
positions specified in that clause. This requirement is not met, and the logical record is not
released.
Either the file has sequential organization, and is not open in I-O, OUTPUT, or EXTEND
mode; or the open mode is I-O, and the file device is not a terminal, process, or $RECEIVE.
“48”
• Variable-Length Records
An Enscribe structured file can have variable-length records. See READ for Sequential or
Dynamic Access (page 405).
When you write to a file that is defined as having variable-length records, the length of the
record written depends on whether the file is declared with
RECORD CONTAINS rec-1 TO rec-2 CHARACTERS
or
RECORD IS VARYING IN SIZE FROM rec-1 TO rec-2 CHARACTERS
DEPENDING ON rec-size
form of the RECORD CONTAINS clause.
In the former case, the length of the record specified in the WRITE statement is the number of
characters written to the file system file.
In the latter case, the length of the record written is the value present in the rec-size data
item specified in the DEPENDING clause at the time the WRITE statement is executed.
• Sequential Access
For files of relative organization, records are released in relative number order, beginning at
1. When the file has an associated relative key data item, that item is set to the current record
number at each successful release.
For files of indexed organization, the program is responsible for setting the prime record key
data item to a desired value prior to the execution of a WRITE statement for that record. In
the case of sequential access, the records must be released in ascending order of prime record
key value.
496 Procedure Division Verbs










