COBOL Manual for TNS and TNS/R Programs
Disk Input and Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
28-31
Optimizing Disk File Processing
Optimizing Disk File Processing
The features of Enscribe that protect the database from corruption also slow down the
Enscribe input and output routines. If you can afford less protection, you can improve
the performance of the HP COBOL disk input and output routines. You can afford less
protection when a process has exclusive access to a file, or when it is acceptable that
other processes that read the file might not receive the most recent copy of a changing
record.
These topics explain how to use these types of files to optimize disk file processing:
•
Unstructured Files
•
Structured Files
•
Files With Alternate Keys
•
Partitioned Files
Unstructured Files
A process can read and write unstructured files faster than it can read structured files,
whether the logical records of the unstructured file are blocked or not. A process can
read and write blocked unstructured files considerably faster than it can read and write
unblocked unstructured files.
HP COBOL performs record blocking (for write operations) and deblocking (for read
operations) of unstructured files when all of these conditions are met:
•
The program describes the file’s organization as sequential.
•
The program does not describe the file as being composed of variable-length
records (except in the case of EDIT files, which can be described as having
variable-length records).
•
The program includes a BLOCK CONTAINS clause that specifies an even multiple
of the established record size.
•
The program does not describe the file with a LINAGE clause or an ALTERNATE
RECORD KEY clause.
Structured Files
For structured files, the file system provides two independent record blocking
performance enhancements—cache buffering and sequential block buffering. In
addition, HP COBOL has Fast I-O, a faster enhancement built on top of sequential
block buffering.
The type of record blocking used for a file is determined by number in the RESERVE
clause of the file-control entry.