COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

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:
The file description includes a RESERVE clause with a number specifying the number of blocks
to buffer. The number 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.
The specifications in the OPEN statement, or the attributes derived during the open operation
by some other means (such as from a TACL ASSIGN command), conform to:
The open mode is INPUT or OUTPUT.
If the open mode is INPUT, the exclusion mode is PROTECTED or EXCLUSIVE.
If the open mode is OUTPUT, the exclusion mode is EXCLUSIVE.
NOTE: HP COBOL Fast I-O is not recommended for an indexed file that has had many records
inserted or deleted since it was created. If you want to use HP COBOL Fast I-O on such a file, first
use FUP RELOAD to reorganize it.
If all of the preceding qualifications are satisfied at run time, HP COBOL Fast I-O is used only if
memory resources are available. For a file opened for output, the loader creates the file. The loader
is also used by FUP, SQL/MP, and other products. The loader manages its own extended data
segment to write the file. The loader requires local storage, which is allocated by the run-time
system. The amount of local storage is approximately 800 bytes (the exact amount depends on
the type of the file and other factors). If the necessary storage is not available, the OPEN statement
returns file status “07” and buffered cache is used to write the file.
For a file opened for input, HP COBOL Fast I-O allocates space for double buffering from a buffer
pool that is in its own extended data segment and is of a fixed size. Buffer size is determined by
multiplying the number in the RESERVE clause by the data block size of the file (to see this size,
use the command FUP INFO file-name, DETAIL). Then, based on various factors such as
the maximum transfer allowed, a read buffer size that is not larger than 30,720 bytes is selected.
The total space allocated from the buffer pool is twice the read buffer size. If there is not enough
space (as when several files are opened for input using HP COBOL Fast I-O at the same time), the
OPEN statement returns file status “07” and sequential block buffering is used for the file.
The buffer pool space returns to the pool when the file is closed. The SAME AREA clause has no
effect on allocation or deallocation from this buffer pool.
If the file is being created and the maximum file size is exceeded, the corrupt bit is set in the file
header and the program terminates abnormally. Attempting to open the file causes a file system
error. If the file is sequential, you can use FUP to clear the corrupt bit and read what was written
to the file (all of the records you released with WRITE will probably not be there). If the file is
relative or indexed, the file is unusable.
Optimizing Disk File Processing 879