COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
file-name
is the file description name of the file to retrieve a record from.
data-name
is the identifier of the data area defined by your program to which the contents of the record
area are transferred after the read operation is complete.
data-name cannot be an index-name or the identifier of an index data item. The transfer is
conducted as if it were a move from an alphanumeric item to an alphanumeric item.
The INTO phrase is allowed only when either:
• All records associated with file-name are defined as data structures or as elementary
alphanumeric items and data-name is either a data structure or an elementary
alphanumeric item.
• Only one record is associated with file-name.
imperative-stmt-1
is an imperative statement to be performed when the end of the file is encountered at the
beginning of the read operation. This phrase is required if no USE statement is applicable for
the file. If both a USE statement and an AT END phrase are present, only the AT END phrase
is used.
imperative-stmt-2
is an imperative statement to be performed when the end of the file is not encountered at the
beginning of the read operation.
END-READ
ends the scope of the READ statement, causing the READ to be a delimited-scope statement. If
the READ statement does not end with an END-READ phrase, the presence of the AT END or
the NOT AT END phrase causes the READ statement to be a conditional statement, which ends
at the next period separator.
WRITE Statement
The WRITE statement for a line sequential file has this syntax:
722 Using HP COBOL in the OSS Environment










