COBOL Manual for TNS and TNS/R Programs

Disk Input and Output
HP COBOL Manual for TNS and TNS/R Programs522555-006
28-2
Allocation
Allocation
The file system allocates physical storage for a disk file in the form of file extents. A file
extent is a contiguous block of storage, starting on a disk sector boundary and
containing a multiple of 2,048 bytes (up to 134,215,680 bytes). The file system permits
a disk file to have up to 978 extents—one primary extent and up to 977 secondary
extents. The primary extent can be a size different from that of the secondary extents.
The file system allocates extents only when needed. The file extents that constitute a
file are not necessarily contiguous. When all extents are allocated, writing to the file
causes I-O file status code “34.”
HP COBOL has no mechanism for specifying extents. If an HP COBOL program
creates a disk file, it allocates a primary extent of 4 x 2,048 bytes and a secondary
extent of 20 x 2,048 bytes. An HP COBOL program can call the routine
COBOL_CONTROL_ to allocate and deallocate extents.
If you create a disk file outside of HP COBOL and do not specify extents, the file
system allocates a primary extent of 2,048 bytes. If you do not explicitly specify a
secondary extent, the file system allocates secondary extents, as needed, that are the
same size as the primary extent.
Partitioned Files
An Enscribe disk file can be composed of up to 16 partitions. Every partition consists of
a primary extent plus up to 977 secondary extents. Each partition must reside on a
different volume. If your system is connected to a network, either through Expand or
through the fiber optic extension (FOX) of the interprocessor bus, the partitions can
even reside on different systems (at a performance penalty). For information about
Expand, see the Expand Network Management and Troubleshooting Guide.
An HP COBOL program can read or write a partitioned file but cannot create one. You
must use FUP to create a partitioned file; for details, see the Guardian Programmers
Guide.
Partitioned files have these significant advantages:
They can be up to 16 times as large as nonpartitioned files.
They can be accessed faster because separate read heads are used.
The loss of access to a disk need not mean the loss of access to the entire file.
Purging Files or Their Data
You can purge a file from the disk from your TACL session with the TACL command
PURGE. An HP COBOL program can purge a file from the disk by calling the operating
system routine PURGE. Purging a file from the disk merely removes the disk file from
the directory and frees the disk space for use by other files; it does not erase the data
on the disk.