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:
|
| maximum record length in the K-SAM file |
| 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:
|
| usable block length available for user data in an NK-SAM file |
| 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:
|
| space required for the NK-SAM file in PAM pages |
| space required for the K-SAM file in PAM pages |
| 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.