Introduction to Data Management

Managing Records With ENSCRIBE
4-2 15873 Tandem Computers Incorporated
Relative files consist of a series of numbered slots. Each slot holds a fixed-
length record, and each record’s primary key is the number of the slot (called
the record number) that the record occupies. For example, in a relative file
containing employee data, if the records for employees 1002, 1003, and 1001
occupy the first, second, and third slots of the file, the primary keys for these
three records are 1, 2, and 3, respectively.
Entry-sequenced files contain records stored in chronological order. Records
in this file appear in the order in which they were actually entered. Thus, if
you enter the records for employees 1003, 1002, and 1001 into an entry-
sequenced file in succession, they are stored in the sequence 1003, 1002, and
1001. The primary key of an entry-sequenced file is a record address generated
by the system.
Unstructured files supported by ENSCRIBE normally contain text produced by
text editors (such as source code or documentation) or object code generated by
compilers, rather than data used by applications. You can think of an
unstructured file as an enormous byte array, with each record containing a string
of characters. The organization (record length and location) of this kind of file is
entirely the responsibility of the process that uses it. The process accesses the data
in terms of an offset, in bytes, from the first byte in the file.
Each type of file has its own advantages. For instance, key-sequenced files are useful
where access and order by key value are important. Relative files are useful where
random access of fixed-length records is significant. The needs of your application
determine which kind of files to use.
Multiple-Key
Record Access
In addition to access by their primary key, all structured files can be accessed by way
of alternate keys. An alternate key is a data field that you designate for providing a
separate, alternative access path to the records in the file. Each file can include up to
255 alternate key fields.
Primary-key values are always unique, but alternate-key values need not be unique—
and, in fact, usually are not unique.
Typically, you use a primary key value to locate one unique record among other
records in the same file. For example, in Figure 4-1, the NAME field is the primary
key and the primary key value JONES, J.A. locates the only record having that name.
With alternate key values, however, you can access a subset of records that all contain
the same value in a particular field. For instance, in Figure 4-1, with the REGION field
as an alternate key, you can use the value CENTRAL to access only records
pertaining to personnel in the central region. Alternate key values, effectively,
subdivide a file into meaningful subsets of records.
Partitioned Files ENSCRIBE allows you to partition a file across multiple disk volumes. For each file,
as many as 16 partitions are permitted.
Partitioning allows you to create files whose length is not limited by the size of a
physical disk volume. Furthermore, because separate volumes need not reside on the
same system, you can spread a single file among different network nodes.