Enscribe Programmer's Guide
• Extents: a unit of storage allocation for a file to be allocated as contiguous space on disk.
Each extent consists of some specified number of 2048-byte pages.
• Block: the unit of physical I/O. A block consists of one or more logical records plus some
control information for structured files. When you are using sequential block buffering, a block
is the unit of transfer between the file system and the disk process. The block size is specified
as a number of bytes. The block sizes currently supported are 512 bytes, 1 KB, 2 KB, and 4
KB. 32 KB block size is only supported for key-sequenced files with increased limits.
• Key: a value associated with a record (a record number, for example) or contained within a
record (as a field) that can be used to locate one record or a subset of records in a file.
Disk File Organization
A disk file must be created before it can be accessed. You can create a file either by calling the
FILE_CREATE_ procedure or by using the File Utility Program (FUP) CREATE command, then designate
the file as either permanent or temporary. A permanent file remains in the system after access is
terminated; a temporary file is deleted when all its openers have closed it. You also specify the
file's type when you create it. Taken as a group, key-sequenced, queue, entry-sequenced, and
relative files are known as structured files. The facilities available with structured files differ
significantly from those available with unstructured files.
The disk process allocates physical storage to files in the form of extents, each consisting of some
number of contiguous 2048-byte pages on the disk.
A partitioned file (one having extents on more than one disk volume) other than a key-sequenced
file is limited to 16 extents per partition. The maximum number of extents in a non partitioned file
or a partitioned file is restricted by the maximum label size up to a limit of 978 extents per file (or
per partition for partitioned key-sequenced files). The maximum label size is further constrained by
the number of alternate keys and partitions defined for this file, by the file format, and by whether
the file is an SMF file. Within this limit, you can use the MAXEXTENTS attribute to set an arbitrary
limit for any nonpartitioned file (or for any partition of a key-sequenced file).
NOTE: For all Enscribe file types, the disk process constrains the use of MAXEXTENTS such that
any partition is always smaller than two gigabytes if the file is format 1.
In any case, the first extent is designated the primary extent and can differ in size from the remaining
secondary extents. This allows a file to be created with a large primary extent, to contain all the
data to be initially placed in the file, and smaller secondary extents to use minimal increments of
disk space as the file grows.
An application process can allocate one or more extents in an open file by way of a CONTROL
21 procedure call. The CONTROL procedure can also deallocate unused extents.
Unstructured Files
An unstructured disk file is essentially a large byte array. Most often it is used as a code file or an
edit file, not as a data file. The organization of an unstructured disk file (the lengths and locations
of records within the file) is entirely the responsibility of the application process.
Data stored in an unstructured file is addressed in terms of a relative byte address (RBA). A relative
byte address is an offset, in bytes, from the first byte in the file; the first byte is at RBA zero.
Structured Files
The Enscribe product provides four types of structured files: key-sequenced, queue, entry-sequenced,
and relative. Data transfers between an application process and a structured disk file are done in
terms of logical records and record keys.
For key-sequenced files, the primary key is a particular data field, designated by the user, within
each data record. For queue files, the primary key resides within the data record and consists of
an 8-byte timestamp plus an optional user key. For entry-sequenced files, the primary key is a block
20 Introducing the Enscribe Record Manager