COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-179
READ for Sequential or Dynamic Access
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:
°
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.
LOCK
keeps other programs from accessing the record retrieved until an UNLOCKFILE
statement, UNLOCKRECORD statement, or REWRITE UNLOCK statement
executes. The file that file-name specifies must be associated with a disk
device.
PROMPT
displays prompt-item to the file before a READ operation (as in a COBOL
requester communicating with a server). The PROMPT phrase is permitted only for
files whose organization is SEQUENTIAL and works only for terminals, processes,
operator consoles, and communication system submanagers. If the PROMPT
phrase is specified for other devices, such as disk files, it is ignored.
prompt-item
is a DISPLAY data item that starts at the beginning of a record of the file
associated with file-name.
prompt-item is ignored if the file against which the READ is executed is open in
INPUT, OUTPUT, or EXTEND mode, or if the file is assigned to a device not
capable of supporting such operations (such as a disk file). For further information
on the use of prompt-item, see PROMPT phrase.
wait-time
is the time interval, in seconds, in which the operation must complete. wait-time
can be a literal or the name of a data item. In either case, it must have a value
described with at most seven digits preceding any decimal point position. Any
fractional portion is truncated to two decimal places.
If file-name was not opened with a TIME LIMITS phrase, including wait-time
in the READ statement causes a run-time error.