Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Using NK-ISAM

Using ISAM pools

For processing without shared-update, each user may decide whether his files are to be processed in user pools or in standard pools provided by the system.

If maximum performance is desired for large applications, user ISAM pools should always be used, since this is the only way of matching the pool size to the application's requirements.

Standard pools can be used if the user works only occasionally with ISAM and generally has small applications. Standard pools may also be suitable in the initial stages of the changeover from K-ISAM to NK-ISAM.

Defining the size of ISAM pools

For the user, the question of the optimum pools size applies only to the user pools. The possibility of loading a complete file into an ISAM pool, so that no I/O operations are necessary during file processing, can be utilized only for small files: the maximum pool size is 4096 PAM pages.

ISAM pools should be capable of holding all of the index blocks of a file, together with at least one data block for each job which accesses the file. When calculating the optimum pool size, the size of the real memory must also be taken into account since large ISAM pools without sufficient real memory will result in an increase in the paging rate. Furthermore, a distinction can be made between “active files” which are accessed frequently and files to which access occurs only occasionally: only “active files” occupy space in the ISAM pool.

Sequential file processing in ISAM pools

For sequentially processed files, the I/O rate can be reduced only slightly. In task-specific pools, for example, block switching is carried out by linear incrementation of the index entries, and access almost always affects the same index blocks. Another way of optimizing file processing is by using larger blocking factors. For sequential processing, therefore, large pools are not advisable.

Record length

Since each PAM page starts with a 16-byte control field, the space available in each block is reduced accordingly. To avoid the creation of overflow blocks, the record length should comply with the following rule:

RECSIZE <= (n * 2048) - (n * 16) - 16 - F - T

F

Record format F = 0/4 for RECFORM = V/F

T

Time stamp T = 0/8 for files without/with duplicate keys

(n * 2048) describes the block size; (n * 16) describes the block control field at the start of each PAM page.

Flag processing

As the flags are no longer included in the index, flag processing in NK-ISAM is implemented simply in the form of a sequential search through file sections. This can result in a serious drop in performance. In the GETFL macro, the range to be searched should be kept as small as possible by specifying appropriate values in the LIMIT operand.

Key position and index length

The ISAM index must not extend into an overflow block. The following rule thus applies to the index structure (taking due account of existing flags):

KEYPOS + KEYLEN + VALLEN + LOGLEN <= n * 2032 - 16 - F

n

Blocking factor in BLKSIZE=(STD,n), where 1 <= n <= 16

F

Record format

  • F = 0 for RECFORM = V
  • F = 4 for RECFORM = F
ISAM pools and BLKCTRL = DATA without NK-ISAM

If a user attempts to create ISAM pools or to process NK-ISAM files (BLKCTRL=DATA) although NK-ISAM is not loaded on his/her system, processing is aborted with an error message. For ISAM pool macros, a return code is placed in the standard header of the operand list. The FCB of the related file contains an error code in field ID1ECB.

ISAM files copied to tape

ISAM files can be saved to tape, but they cannot be processed as tape files with ISAM.

No information about the data format (BLKCTRL or BLOCK-CONTROL-INFO, as appropriate) is kept on tape. This information is lost for files copied to tape (with COPFILE or COPY-FILE) if the catalog entry for the file is deleted.

If the file is to be copied back to disk, the COPFILE macro must be preceded by a FILE macro with the operand STATE=FOREIGN or the COPY-FILE command must be preceded by an IMPORT-FILE command, as appropriate. The user must specify the correct value for the operand BLKCTRL or BLOCK-CONTROL-INFO, namely PAMKEY or DATA (macro) or *PAMKEY or *WITHIN-DATA-BLOCK (command) to match the actual data format.

If a K-ISAM file (BLKCTRL=PAMKEY) is inadvertently copied back to disk as an NK-ISAM file (BLKCTRL=DATA), the resulting disk file cannot be read since the first 16 bytes of each PAM page, which contain data in the format BLKCTRL=PAMKEY, are overwritten with management information.

OPEN errors when processing NK-ISAM files
  • NK-ISAM file on tape: an invalid data format was specified in the FILE or FCB macro, or in the IMPORT-FILE command, when importing the tape file or writing it back to tape.

  • ISAM pool is overloaded: if the ISAM pool in which an NK-ISAM file is to be opened is overloaded, OPEN processing is rejected with error message DMS0D9B.