Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

NK4 format

In order to support NK4 volumes, a new format called the NK4-ISAM block format has been introduced:

A logical block consists of a sequence of 4K blocks, which correspond to the transport unit for NK4 volumes. Each 4K block begins with a block control field which is made up of a general part comprising 12 bytes and an ISAM-specific part of 4 bytes.

A data block consists of a sequence of at least one and at most eight 4K blocks. The size of the logical data block is controlled by a specification in the FCB or FILE macro or in the ADD-FILE-LINK command. The layout of an NK4-ISAM block corresponds to that of an NK2-ISAM block. The addressing of records and the management of free space are handled via the block trailer.

Maximum record length / Usable block length

The total length of an NK-4K data block cannot be fully used for the user's records, since 16 bytes are used for the block control field by the system for each 4K page of the block, and a further 16 bytes per block are reserved for the block trailer. The effectively usable length of an NK-4K block of a file with block size (STD,n), where n is even, is thus as follows:

  • The maximum permissible record length is determined by the specified block size
    (in the BUFFER-LENGTH operand of the ADD-FILE-LINK command or the BLKSIZE operand of the FILE macro): n * 2048, n = 2, 4, 6, 8

  • The usable block size is the block size minus the space needed for management information and the time stamp.
    (16 bytes are used for the block control field by the system for each 4K page of the logical block, and a further 16 bytes per block are reserved for the block trailer.)

  • Since ISAM places a 4-byte record length field in front of each record, the usable block size for records with RECFORM=F is reduced by a further 4 bytes.
    (Each data block must contain at least one record.)

Since the maximum record length corresponds to the logical block size given above rather than the effective block length (so as to ensure compatibility with the “K” formats), the length of a record may exceed the effective block length. An overflow block associated with the data block is created in such cases. The part of the record that could not be accommodated in the data block is stored in it (the size of the overflow block is 4K). The position and length of a key are subject to the same restrictions as for NK2-ISAM format, i.e. the key may not be fully or partially located in the overflow block in either NK4-ISAM or NK2-ISAM format.

Index data blocks consist of a minimum of one and a maximum of eight 4K blocks, with a block size that corresponds to that of the data block.

Index blocks are made up of exactly one 4K block. The index information is structured at two levels: in sections and entries, with the length of a section adjusted to the new index block size of 4K.

The control block is the first block of an ISAM file. It is made up of exactly one 4K block. It has the same layout as in the 2K format. The space in excess of 2K is not used.

Free blocks resulting from data or index data blocks are made up of a minimum of one and a maximum of eight 4K blocks. Free blocks obtained from index or overflow blocks consist of exactly one 4K block.

An NK4-ISAM file must be created with an even blocking factor. This can be done as follows:

  • automatically, if the file is located on an NK4 disk (NK4 PVS)

  • by an explicit specification from the user (in the operand BLOCK-CONTROL-INFO= WITHIN-DATA-4K-BLOCK of the ADD-FILE-LINK command or the operand
    BLKCTRL=DATA4K of the FILE/FCB macro)

For more information on the buffering of NK4-ISAM files in ISAM pools, see section "NK4-ISAM files in ISAM pools".