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 block formats

&pagelevel(4)&pagelevel

BS2000 supports data volumes with different formats:

  • Key data volumes for storing files with the block control information in a separate field ("PAMKEY") per 2Kbyte data block. These files have the block format PAMKEY.

  • Non-Key data volumes for files without separate PAMKEY fields. The block control information is either omitted (block format NO) or stored in the respective data blocks (block format DATA).

Additionally, NK volumes are distinguished by the minimum size of the transfer unit. NK2 volumes have a transfer unit of 2Kbyte. NK4 volumes have a transfer unit of 4Kbyte.

The block format is controlled by the BLOCK-CONTROL-INFO operand in the ADD-FILE-LINK command. Please refer to the "DMS Introductory Guide" manual for a detailed description of the BLOCK-CONTROL-INFO operand, various file and data volume structures and the conversion from K file format to NK file format.

If the ADD-FILE-LINK command is not used when a new file is created or BLOCK-CONTROL-INFO=BY-PROGRAM is specified, the default values of the C runtime system are used. These values depend on the disk type, on the CLASS2-OPTION that can be specified by the system administrator, and on the access method:



File
organization

CLASS2-OPTION BLKCTRL = NONKEY

not specified

specified

K disk

NK disk

K disk

NK disk

SAM

PAMKEY

DATA

DATA

DATA

ISAM

PAMKEY

DATA

DATA

DATA

PAM

PAMKEY

NO

NO

NO

 

K and NK-ISAM files

ISAM files in K format which make 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 since the DMS forms extensions of 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 consequently the number of input/output operations during file processing

  • under no circumstances may the ISAM key be in an overflow block.

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 can be used for NK-ISAM files.

Usable area for records (NK-ISAM files)

For ISAM files the following table can be used to calculate the space available for records per logical block.

File format

RECORD-FORMAT

max. 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 lower 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 lower 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 2-byte long record pointer for each record.
For RECORD-FORMAT=FIXED there is a 4-byte record length field for each record but this is not included in 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 to the next lower number

divisible by 4: 4044 (bytes).