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-SAM/NK-SAM conversion

Converting K-SAM files into NK-SAM files

Prerequisites

K-SAM files can be converted into NK-SAM files using either of the utility routines
PAMCONV (see the “Utility Routines” manual [13 (Related publications)]) or PERCON (see the “PERCON” manual [12 (Related publications)]). Conversion is possible only if the maximum record length in the K-SAM file is not greater than the usable block length of the NK-SAM file minus 16 bytes. For a K-SAM file with BLKSIZE=(STD,n) or BUFFER-LENGTH=*STD(SIZE=n), the following condition must therefore be fulfilled:


Maximum record length:

RECSIZE K-SAM <= (n * 2048 - 16)

RECSIZEK-SAM

maximum record length in the K-SAM file

n

blocking factor from BLKSIZE=(STD,n), 1 <= n <= 16


Optimizing block usage

After conversion, K-SAM files which fulfill the above condition with regard to the record length but which use all the available bytes in the logical block in K-SAM format for user data will require considerably (up to 100%) more storage space. The reason for this is that fewer records will fit into a logical block because of the reduced usable block length in NK-SAM format. This reduced effective block length must be taken into account if all the available bytes of a logical block are to be used in the NK-SAM format for user data (see "Logical block in an NK-SAM file"):


Usable block length:

NBLN K-SAM <= (n * 2048 - 16)

NBLNK-SAM

usable block length available for user data in an NK-SAM file

n

blocking factor from BLKSIZE=(STD,n), 1 <= n <= 16


Space requirements

When a K-SAM file is converted to NK-SAM format, the space required for a file with variable-length records increases by an average of 1%.

The increased space requirements for a file with fixed-length records when converted from K-SAM to NK-SAM format can be calculated using the following formula:


Space required for an NK-SAM file:

#PAM-pages NKSAM = (n * 2048 / (n*2048 -16)) * #PAM-pages K-SAM

#PAM pagesNK-SAM

space required for the NK-SAM file in PAM pages

#PAM pagesK-SAM

space required for the K-SAM file in PAM pages

n

blocking factor from BLKSIZE=(STD,n), 1 <= n <= 16


Converting NK-SAM files into K-SAM files

NK-SAM files can be converted into K-SAM files with the aid of the PAMCONV utility routine (see the “Utility Routines” manual [13 (Related publications)]) or the software product PERCON (see the “PERCON” manual [12 (Related publications)]).

Compatibility

NK-SAM offers the user the same functional scope, with identical interfaces, as K-SAM.

However, when converting from K-SAM to NK-SAM, it may be necessary to modify programs which use their own algorithms for determining the retrieval addresses for records, since the blocking of the file to be processed may change during conversion. Due to the reduced usable block length, it may happen that each block contains one record less and that the file size increases. In such cases, the calculation algorithm for retrieval addresses must be modified.

Applications which use the retrieval address made available by DMS in the FCB (see section "FCB retrieval address") require no such modifications.