Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ISAM - Indexed-Sequential Access Method

ISAM, like SAM, is a record-oriented access method for disk files. In contrast to SAM files, however, ISAM files can be processed directly as well as sequentially: With the aid of a key area in each record (known as the ISAM key or primary key), the records are placed in the data blocks of an ISAM file. DMS then manages these data blocks with the aid of index blocks such that each record can be accessed directly by way of its key.

Block formats

There are two versions of the access method ISAM, capable of processing files with two different block formats (see section "Block formats for disk files").

  • NK-ISAM (Non-Key ISAM) processes files with the block format “DATA”: These do not contain a separate PAM key. The DMS management information is kept in a block control field within the PAM page.

  • K-ISAM (Key ISAM) processes files with the block format “PAMKEY”: these are characterized by the fact that DMS management information for each PAM page is kept in a separate PAM key located outside the page.

By means of the BLKCTRL operand in the macros FILE and FCB or the BLOCK-CONTROL-INFO operand in the ADD-FILE-LINK command, the user can select whether a K file or an NK file is to be processed:

  • BLKCTRL=DATA/DATA2K/DATA4K specifies an NK-ISAM file

  • BLKCTRL=PAMKEY declares a K-ISAM file

If you make no explicit specification for BLKCTRL, the BLKCTRL system parameter controls in general whether the file is created ond K disks with the BLKCTRL=PAMKEY or DATA/NO attribute.
On BS2000 OS DX and higher and specifically for creating ISAM files, the ISBLKCTL system parameter controls whether the file is created as an NK-ISAM file on K disks.
Because in practice K-ISAM is becoming less and less important, the default setting for ISBLKCTL is c'NONKEY', e.g. by default, ISAM files are created as NK-ISAM on K disks as well.

NK-ISAM offers the user all functions of K-ISAM, with almost identical interfaces. In contrast to K-ISAM, NK-ISAM uses ISAM pools for read and write access: these are areas in main memory in which large portions of the ISAM files being processed are held. The resulting reduction in the number of physical I/O operations provides accelerated access, particularly in the case of non-sequential accesses. (Further information on ISAM pools can be found under "Overview of the most important functions of NK-ISAM").

The records of NK-ISAM files may contain, in addition to the ISAM key (primary key), up to 30 so-called secondary keys (alternate indices), via which the user can locate the desired records in exactly the same way as via the primary key. This added function makes processing of ISAM files far more flexible than was possible via the primary key alone.

NK-ISAM files must be further differentiated into NK2-ISAM files and NK4-ISAM files (see also the section "NK4 format").

This section describes the access method ISAM, i.e. the functions supported by NK-ISAM and K-ISAM. References are made at the appropriate points to special features and incompatibilities, and these are also summarized in section "Compatibility".

The following sections first provide a brief description of the functions of NK-ISAM. This is followed by a description of the file structure of NK-ISAM and K-ISAM files, the processing of NK-ISAM files in ISAM pools, ISAM-specific processing attributes, shared-update processing, OPEN modes, and programming tips for ISAM processing. Further sections contain notes on the use of NK-ISAM and on conversion from K-ISAM to NK-ISAM and information about the “crash behavior” of ISAM files.

Overview of the most important functions of NK-ISAM

ISAM pools

The number of I/O operations can be reduced for non-sequential processing if large parts of the file can be kept resident in main memory. ISAM pools contain, in addition to the data and index blocks, the necessary management information. Users can create and manage their own ISAM pools via a command interface or a macro interface, thereby allowing them to optimize file processing. If the user does not make use of this option, NK-ISAM creates user-specific standard pools in which it then buffers the files to be processed.

Key compression

The length of the index entries is minimized by using compressed keys. This increases the number of keys which can be kept in an index block.

Locks

External locks are implemented as key locks or, for sequential processing, as extent locks.

Block merge

NK-ISAM guarantees that each data block will be at least 40% full and each index block at least 45% full. If the contents of a block drop below this limit, they are moved to neighboring blocks or merged with the contents of a neighboring block.

Secondary keys

In addition to the ISAM key (primary key), the user may define up to 30 secondary keys in a record. A record can then be accessed via any of these secondary keys (alternate indices). A command interface and a macro interface permit the user to define and delete secondary keys, as well as to request information on them. For access to records via the secondary keys, NK-ISAM has additional operands in the macros for read and pointer operations.