COBOL Manual for TNS and TNS/R Programs

Using HP COBOL in the OSS Environment
HP COBOL Manual for TNS and TNS/R Programs522555-006
19-20
READ Statement
READ Statement
The READ statement for a line sequential file has this syntax:
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.
LOCK
keeps other programs from gaining access to the record retrieved until an
UNLOCKFILE or UNLOCKRECORD statement is executed. The file specified by
file-name must be associated with a disk device.
file-nameREAD
END-READ
data-nameINTO
NOT
AT
END imperative-stmt-2
AT
END imperative-stmt-1
VST630.vsd