COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-193
READ for Line Sequential Files
READ for Line Sequential Files
READ for line sequential files reads the next record in the file.
file-name
is the file description name of the file to retrieve a record from.
NEXT
indicates that the next record is to be read (that is, the record after the current
record, according to the key of reference). NEXT is required for sequential reading
of a relative, indexed, or queue file whose access is DYNAMIC.
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 one of these conditions is true:
°
Only one record is associated with file-name.
°
The record associated with file-name is defined as a data structure or as an
elementary alphanumeric item and data-name is either a data structure or an
elementary alphanumeric item.
file-nameREAD
END-READ
data-nameINTO
NOT
AT
END imperative-stmt-2
AT
END imperative-stmt-1
VST630.vsd