COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-190
READ for Sequential or Dynamic Access
Use of the READ NEXT Statement on Relative, Indexed, or Queue Files
The READ NEXT statement operates on a relative, indexed, or queue file only if
the file is declared with ACCESS MODE SEQUENTIAL or ACCESS MODE
DYNAMIC.
Sequential Block Buffering and HP COBOL Fast I-O
Sequential block buffering, enabled by the RESERVE clause of the FILE-
CONTROL Paragraph, is an Enscribe feature that speeds the reading of a
sequential, relative, indexed, or queue file by reading a block of records together
into a memory buffer. HP COBOL Fast I-O is a variant of sequential block buffering
that is even faster, because the run-time routines handle the record deblocking.
For either of these features, the file’s access must be sequential. In the non-CRE
environment, its organization must be sequential. In the CRE, its file organization
must be sequential, relative, indexed, or queue. See FILE-CONTROL Paragraph.
Eight-Character Volume Names and HP COBOL Fast I-O
If you use an eight-character volume name in this context, you do not get an error
or warning, but you get normal output instead of fast output. (Input is not affected.)
Example 9-57. Reading a Sequential File
IDENTIFICATION DIVISION.
...
ENVIRONMENT DIVISION.
...
SELECT INPUT-DATA
ASSIGN TO "$TAPE"
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS INPUT-DATA-FILE-STATUS.
...
DATA DIVISION.
FILE SECTION.
FD INPUT-DATA.
01 INPUT-RECORD.
...
WORKING-STORAGE SECTION.
...
01 FILE-STATUSES.
03 INPUT-DATA-FILE-STATUS PICTURE XX.
...
PROCEDURE DIVISION.
...
READ INPUT-DATA
AT END CLOSE INPUT-DATA
END-READ
IF ...