Enscribe Programmer's Guide

Figure 2 Primary Keys in Structured Files
Name<record address>
Description<record number>
Account Number
Item
Entry-Sequenced Files:
Relative Files:
Primary Key
Primary Key
Primary Key
Key-Sequenced Files:
Name Address Region
Primary Key
Queue Files:
TimestampMfg. Site
Part Number
Description
Except for queue files, structured files can also include up to 255 alternate-key fields. As illustrated
in Figure 3 (page 26), an alternate key is a designated data field within the record whose values
can be used at execution time to logically subdivide the overall file into meaningful subsets of
records. In an employee data file, for example, one data field in the record format might be the
employee's region code; if you define that field as an alternate key, you can access only those
data records that pertain to the employees who all reside in a particular geographic region.
As illustrated in Figure 4 (page 27), primary-key values are always unique, but alternate-key values
can be the same from one record to another.
Figure 3 An Alternate-Key Field
Alternate-Key Field
Name Address Region
The Enscribe software lets you use the primary-key value to locate one unique record among other
records in the same file. For example, in Figure 4 (page 27), the name field is the primary key
and the primary-key value JONES, J.A. locates the only record having that name.
26 Positioning Within Structured Files