Keys play a very central role in indexed-sequential data processing.
Keys define the order of the records within an indexed-sequential file. A key is always part of a record and is defined by the key field (position and length) within each record of an indexed-sequential file. The content of a key field is the key value. In addition, a key can have a name if, for example, this is necessary to distinguish different keys in an implementation.
A distinction is made between primary and secondary keys. Each indexed-sequential file always has precisely one primary key and can have one or more secondary keys. Secondary keys must always have a unique name. If a file has several keys, each of these keys may define a different order.
Identical key values in different records are permitted for a key.
Special features of the BS2000 access method ISAM
For ISAM files, an unnamed primary key is always defined. Only for NK-ISAM files can several secondary keys (up to 30) be defined in addition. The secondary keys must always have a unique name (up to 8 characters). The restrictions which apply for ISAM (for example regarding key length) must naturally also be taken into account when the JRIO interfaces are used. Identical secondary keys in different records are only permissible if no identical key values are permitted in different records for the primary key and if and if identical key values in different records have already been permitted for all other secondary keys.
The marking options (value flag and logical marking) which ISAM offers are not supported by JRIO.
Note that at the ISAM DMS interfaces, positions within a record, in particular key positions, can be numbered differently than at the JRIO interfaces (see section "Record").