KSAM/3000 provides a number of features beyond the standard indexed sequential access method.
These include:
Retrieval by Approximate Match
Fixed or Variable Length Data Records
MULTIPLE KEYS |
 |
Each data record can contain from one to sixteen keys. Of these keys, one is required, called the primary key; any others are alternate keys. For example, in an employee record, the primary key could be the employee's social security number; alternate keys might be the employee's name, phone number, or zip code. The values in these key fields determine the orders in which data records are sequenced.
PRIMARY KEY. One field in each data record is defined to contain the primary key. The value in this field determines the primary sequence of records in the data file. Records are sequenced according to this primary key unless sequencing by an alternate key or inchronological order is specifically requested.
ALTERNATE KEYS. Other fields within each data record can be designated as alernate keys to
be used for alternate sequencing of records. Up to 15 alternate keys can be designated for each
record, however, each additional alernate key adds to the overhead and can affect performance
when accessing and maintaining a file. The file can be sequenced in a different order for each
alternate key defined for the file.
Note that alternate keys bear no hierarchical relation to each other or to the primary key. Each key is ordered in sequence by its value and type with no relation to other keys. In KSAM, sequence always means ascending sequence according to the ASCII collating sequence, (refer to appendix C.)
APPROXIMATE MATCH |
 |
When retrieving by key value, you can specify that the key you are looking for have a value that
exactly matches a specified value, or you can specify that it bear a certain relation to a specified
value. The choices are: equal to, equal to or greater than, or greater than. The last two relations
let you search for an approximate match. For example, you can retrieve all records with a date
greater than or equal to a given date:
DATA RECORD FORMAT |
 |
Every key entry in the key file contains, in addition to the key value, a pointer to the corresponding
data record in the data file. The data records can be either fixed length or variable length. If they
are fixed, the data record pointer specifies a record number relative to the beginning of the file. If
the records are variable length, then the pointer indicates the start of the data record as a word
offset from the beginning of the file.