COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
See these usage considerations in READ for Sequential or Dynamic Access (page 405):
• In Action of the READ Statement (Sequential Read):
Retrieval of a logical record◦
◦ Alignment within record area
◦ Unsuccessful read operation
• File-Status Data Item
• Retrieval
• GUARDIAN-ERR Special Register
• Handling Exception Conditions
• Variable-Length Records
• Setting the Value of the DEPENDING Item (Variable-Length Records)
• Concept of Next Record
• Sequential Block Buffering and HP COBOL Fast I-O
• Eight-Character Volume Names and HP COBOL Fast I-O
READ for Random or Dynamic Access
READ is for random or dynamic access reads a record from a file according to the value of a key,
rather than according to the present value of the file position indicator.
For relative files, READ without NEXT sets the file position indicator to the item selected by RELATIVE
KEY (if KEY is omitted) or to the specified alternate key.
For indexed and queue files, READ without NEXT sets the file position indicator to the item selected
by either the key of reference (if KEY is omitted) or to the specified prime or alternate key.
When the selected record exists, the process places its contents in the record area. If it does not
exist, an invalid-key condition occurs, and the process executes either the INVALID KEY statement
or, if there is no INVALID KEY phrase, a USE AFTER EXCEPTION procedure.
When duplicate alternate key values are allowed, the order of records with equal values depends
on the INSERTIONORDER parameter of the alternate key file: records with duplicate alternate key
values are retrieved in either prime key order (the way NonStop systems software ordinarily works)
or in the order in which they were inserted in the file (as specified in the 1985 ISO/ANSI COBOL
standard).
418 Procedure Division Verbs










