COBOL Manual for TNS and TNS/R Programs

Disk Input and Output
HP COBOL Manual for TNS and TNS/R Programs522555-006
28-34
Structured Files
Without sequential block buffering, every time an application program performs a read
operation, the HP COBOL run-time routines must call the READ routine, which causes
the file system to send a message to the disk process and causes the disk process to
return a message containing the record. With sequential block buffering, only entire
blocks are sent, and any records in the block after the first one are delivered from the
process file segment without any message traffic.
HP COBOL provides sequential block buffering for a file when all of these conditions
are met:
The file is structured.
The file’s open mode is INPUT or I-O.
The program declares the file to have sequential access mode (although
organization can be sequential, relative, or indexed).
HP COBOL Fast I-O
Fast I-O is an HP COBOL enhancement in input-output performance beyond that of
sequential block buffering or buffered cache. With HP COBOL Fast I-O, the
HP COBOL run-time routines use an auxiliary block buffer and perform the blocking
and deblocking in local storage. This process operates 2 or 3 times faster than when
the operating environment performs the blocking and deblocking operations.
HP COBOL Fast I-O is available if the HP COBOL program and the structured file
upon which it is to operate meet these criteria:
Either the program runs in the non-CRE environment and the file is organized
sequentially, or the program runs in the CRE (in which case the file can have any
organization).
The file description includes a RESERVE clause with a number specifying the
number of blocks to buffer. In the non-CRE environment, the number must be
greater than 1; in the CRE, it must be greater than 2.
The file description does not include a LINAGE clause or a CODE-SET clause.
The file was not opened with time limits (as with the TIME LIMITS phrase in the
OPEN statement).
The program is not compiled with the NONSTOP directive.
Caution. Do not use sequential block buffering for a file opened for shared access. If you do,
a process could read data that is not up to date while another process alters the file.