COBOL Manual for TNS and TNS/R Programs
Disk Input and Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
28-37
Partitioned Files
Not Updating the Alternate-Key File Automatically
Another way to improve the performance of alternate-key file access is to specify that
the alternate-key file not be automatically updated by the operating environment when
the value of an alternate-key field changes (use the FUP parameter NOUPDATE). This
is appropriate when your only means of updating the file is a batch update program
that runs when no interactive processes are reading the file; you can run the batch
update, then re-create the alternate-key file and reload it. Do not use the NOUPDATE
parameter if the file is updated interactively, because the changed records do not
cause any changes in the alternate-key file until the next batch update.
Partitioned Files
Partitioned files can be accessed faster because separate read heads are used for
each partition. Loss of access to one disk need not mean loss of access to the entire
file.
You can divide an indexed file according to the value of the prime key and have, for
example, A through C on the first disk volume and U through Z on the last disk
volume. If one of the disks is taken offline for maintenance, or if one system of the
network is inaccessible due to communication problems, the remainder of the
partitioned file is still accessible.
To open a partitioned file when some partitions cannot be accessed, an HP COBOL
program must use the routine COBOL85^SPECIAL^OPEN (in the non-CRE
environment) or COBOL_SPECIAL_OPEN_ (in the CRE). If all partitions can be
accessed, an HP COBOL program can open a partitioned file with the OPEN
statement.
For more information about partitioned files, see Partitioned Files.
Optimizing Disk File Storage
You can specify at file creation time that an indexed or data file is to be compressed for
more space-efficient storage at a slight expense of speed. Enscribe compresses
records by eliminating duplicate leading characters from one record to the next and
replacing them with a one-byte count of the duplicate characters. If a file has a
significant amount of duplicated data, the storage saving can be substantial.
The prime key of a compressed file must be at the beginning of the record.
Compression is recommended for an indexed file in which the first records of
successive blocks have similar prime-key values. Compression is recommended for an
alternate-key file in which several alternate keys have the same value.
For more information about compressing indexed and data files, see the Guardian
Programmer’s Guide.