Using KSAM/XL and KSAM 64 (32650-90886)

13
1 Introduction
The Keyed Sequential Access Method (KSAM) is a method of organizing data records
according to the content of key fields within the record. This method allows sequential
processing of records without relying on the physical location of the record in the file.
Every record in a KSAM file contains a primary key field. The content of this field
determines the logical sequence of each record. Alternate keys offer different sequences for
accessing the same records.
KSAM XL and KSAM 64 are KSAM file formats that function in the native mode (NM)
environment of the MPE/iX operating system. They comprise a single file that consists of
an index area that contains key indexes, and a data area that contains data records.
A primary key and up to fifteen alternate keys can be defined for a KSAM XLor KSAM 64
file. Key values are arranged in ascending order based on the data type of the field.
NOTE
The MPE V/E KSAM file format is also available on the MPE/iX system and
is referred to as CM KSAM. It is a two-file format consisting of a data file and
a key file. Refer to the KSAM/3000 Reference Manual for a description of the
format, file building instructions, and maintenance information.
Terminology
In the rest of the book we will use KSAM to denote a KSAM XL or a KSAM 64 file, unless
explicitly stated otherwise. KSAM denotes Keyed Sequential Access Method, the method
of organizing data records according to the contents of key fields within the record.
KSAM XL File Format
A KSAM file is a single file consisting of an index portion and a data portion. Figure 1-1.
provides a general representation of the contents of a KSAM file.