In contrast to conventional K-SAM files, NK-SAM files do not have separate PAM keys outside the PAM pages. Depending on what block format has been defined for an NK-SAM file, block-specific management information is either stored in the logical blocks themselves or simply discarded altogether.
Block format "DATA"
This block format is generated when a file is created with the operand BLKCTRL=DATA of the FILE macro or the operand BLOCK-CONTROL-INFO=*WITHIN-DATA-BLOCK of the ADD-FILE-LINK command. The block-specific management data is stored in a special area of each logical block of the file, namely the 12-byte block control field. NK-SAM adds 4 bytes of information to this block control field indicating the length of usable data in the buffer.
In an NK-SAM file in which n (where n <= 16) 2K blocks (standard blocks) have been grouped together using either the operand BLKSIZE=(STD,n) in the FILE or FCB macro or the operand BUFFER-LENGTH=*STD(SIZE=n) in the ADD-FILE-LINK command to form a logical block, this block has the following structure:
where:
CF | Block control field, 12 bytes. |
DL | Length of the usable data in the buffer, 4 bytes. |
The block control field has the following structure:
where:
CFID | Coded File IDentification: this has the same meaning as in the PAM key (see section "Logical block in a K-SAM file"). |
LBN | Logical Block Number: number of the standard block which contains the block control field. (Standard blocks are numbered sequentially within a file.) |
VN | Version number: this has the same meaning as in the PAM key. |
CFL | Control FLag: the control flag flags gaps within a file. This information is used primarily when copying a file from or to a tape. |
res | Bytes in the block control field which are reserved for future use. |
The 12 bytes of a logical block used for the block control field and the following 4 bytes used for the SAM-specific length field are not available for storing user data. This fact must be taken into consideration when planning blocking factors and record lengths for an NK-SAM file.
The length of the part of a logical block consisting of n standard blocks available for user data (the maximum permissible record length) is thus always calculated as follows, regardless of the record format used:
Usable block size
|
| permissible record length in the NK-SAM file |
| blocking factor from BLKSIZE=(STD,n), 1 <= n <= 16 |
When the buffer offset is used (operand BUFOFF=16 in the FCB and FILE macros or operand BLOCK-OFFSET=16 in the ADD-FILE-LINK command), files with the block format “DATA” can be used for data swapping. These files can be imported into V9.5.
Block format "NO"
This block format is generated when a file is created with the operand BLKCTRL=NO of the FILE macro or the operand BLOCK-CONTROL-INFO=*NO of the ADD-FILE-LINK command. SAM supports this block format only for tape files. No block-specific management information is generated. The user can make use of the full length of the logical block for his/her own data.
A tape file created by another system with block-specific management information can be imported with a special buffer offset (operand BUFOFF / BLKCTRL=NO in the FCB and FILE macros or operand BLOCK-OFFSET / BLOCK-CONTROL-INFO=*NO in the ADD-FILE-LINK command).