Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

K and NK-ISAM files

&pagelevel(5)&pagelevel

ISAM files in K format that use of the maximum record length become longer in NK format than the usable area of the data block. They can be processed in NK format because the DMS creates extensions to the data blocks known as overflow blocks.

The creation of overflow blocks presents the following problems:

  • The overflow blocks increase space requirements on the disk and hence the number of I/O operations during file processing.

  • The ISAM key must not be in an overflow block under any circumstances.

Overflow blocks can be avoided by ensuring that the longest record in the file is no longer than the area of a logical block that may be used for NK-ISAM files.

Usable area for records (NK-ISAM files)

The following table can be used to calculate the amount of space available per logical block for records in ISAM files..

File format

RECORD-FORMAT

Maximum usable area

K-ISAM

VARIABLE

BUF-LEN

FIXED

BUF-LEN - (s*4)
where s = number of records per logical block

NK-ISAM

VARIABLE

BUF-LEN - (n*16) - 12 - (s*2)
(rounded down to the next number divisible by 4)

where n = blocking factor
s = number of records per logical block

FIXED

BUF-LEN - (n*16) - 12 - (s*2) - (s*4)
(rounded down to the next number divisible by 4)

where n = blocking factor
s = number of records per logical block

Explanation of the formulas

For NK-ISAM files, each PAM page of a logical block contains 16 bytes of administrative information. The logical block also contains a further 12 bytes of administrative information and a record pointer with a length of 2 bytes for each record.
For RECORD-FORMAT=FIXED there is a 4-byte record length field for each record, but this is not included when calculating the record length. Consequently, 4 bytes must be deducted per record in such cases.

Example: Maximum record length of an NK-ISAM file (fixed record length)

File definition:

/ADD-FILE-LINK ...,RECORD-FORMAT=FIXED,BUFFER-LENGTH=STD(SIZE=2),

BLOCK-CONTROL-INFO=WITHIN-DATA-BLOCK

maximum record length (according to the formula):

4096 - (2*16) - 12 - 1*2 - 1*4 = 4046, rounded down to the next

number divisible by 4: 4044 (bytes).