The I/O functions of the C runtime library can process disk files with the file attributes listed in the following tables. The default attributes inserted by the runtime system when the user does not specify any options in the ADD-FILE-LINK
command or in the open functions are underlined.
Notes on the following tables
The maximum number of data bytes in the tables indicates the number of characters that can be stored by the C program in a record or block (fixed record length) or the maximum number of characters that can be stored (variable record length).
The size of the logical block (BLKSIZE) varies according to the type and format of the volume:
K and NK2 disks: a standard block (2048 bytes) or the integral multiple of a standard block (max. of 16 standard blocks);
NK4 disks: a minimum of two standard blocks (4096 bytes) or an integral multiple thereof (2, 4, 6, 8 standard blocks).For more information on the block format (BLKCTRL) and the maximum number of data bytes, see also section “K and NK block formats”. It explains, in particular, how overflow blocks can be avoided with NK-ISAM files. Overflow blocks occur if the full length of a transfer unit is utilized when writing records (RECSIZE = BLKSIZE).
In C, the 4-byte record length field in files with variable record length (RECFORM=V) is not counted as part of the record data. The maximum number of data bytes is therefore reduced by 4 bytes.
For files with RECFORM=U, the register in which the length of a record is passed is defined by RECSIZE (RECORD-SIZE parameter in the
ADD-FILE-LINK
command). This register is predefined (R4) and must not be changed.
Table 1: file attributes of textfiles with stream-oriented I/O
FCB-TYPE | REC- | BLKCTRL | BLKSIZE | RECSIZE (r byte) | Maximum number |
SAM1) | V | PAMKEY | 1 <= n <= 16 | 4 <= r <= n*2048-4 | RECSIZE - 4 |
DATA(2K) | 1 <= n <= 16 | 4 <= r <= n*2048-16 | RECSIZE - 4 | ||
DATA(4K) | 2 <= n <= 16 | ||||
U | PAMKEY | 1 <= n <= 16 | BLKSIZE | ||
DATA(2K) | 1 <= n <= 16 | BLKSIZE - 16 | |||
DATA(4K) | 2 <= n <= 16 | ||||
ISAM2) | V | PAMKEY | 1 <= n <= 16 | 12 <= r <= n*2048 | RECSIZE - 12 |
DATA(2K) | 1 <= n <= 16 | 12 <= r <= n*2048 | RECSIZE - 12 | ||
DATA(4K) | 2 <= n <= 16 |
1) | .SAM files are only created in the KR mode (see also the |
2) | The default value for the key position is 5, and the default key length is 8. These values cannot be modified. The user cannot access the keys; they are generated and managed by the C runtime library: when a new ISAM file is created, the first record is assigned the key "00010000", and the key is then incremented in steps of 100 for each further record. |
Table 2: file attributes of binary files with stream-oriented I/O
FCB- | REC- | BLKCTRL | BLKSIZE | RECSIZE | Maximum number |
SAM | F | PAMKEY | 1 <= n <= 16 | 1 <= r <= n *2048-4 | RECSIZE |
DATA(2K) | 1 <= n <= 16 | 1 <= r <= n *2048-16 | RECSIZE | ||
DATA(4K) | 2 <= n <= 16 | ||||
V | PAMKEY | 1 <= n <= 16 | 4 <= r <= n *2048-4 | RECSIZE - 4 | |
DATA(2K) | 1 <= n <= 16 | 4 <= r <= n *2048-16 | RECSIZE - 4 | ||
DATA(4K) | 2 <= n <= 16 | ||||
U | PAMKEY | 1 <= n <= 16 | BLKSIZE | ||
DATA(2K) | 1 <= n <= 16 | BLKSIZE - 16 | |||
DATA(4K) | 2 <= n <= 16 | ||||
PAM | PAMKEY | 1 <= n <= 16 | BLKSIZE | ||
DATA(2K) | 1 <= n <= 16 | BLKSIZE - 12 | |||
DATA(4K) | 2 <= n <= 16 | ||||
NO(2K) | 1 <= n <= 16 | BLKSIZE | |||
NO(4K) | 2 <= n <= 16 |
Table : file attributes of binary files with record-oriented I/O
FCB- | REC- | BLKCTRL | BLKSIZE | RECSIZE | Maximum number |
SAM | V | PAMKEY | 1 <= n <= 16 | 4 <= r <= n *2048-4 | RECSIZE - 4 |
DATA(2K) | 1 <= n <= 16 | 4 <= r <= n *2048-16 | RECSIZE - 4 | ||
DATA(4K) | 2 <= n <= 16 | ||||
F | PAMKEY | 1 <= n <= 16 | 1 <= r <= n *2048-4 | RECSIZE | |
DATA(2K) | 1 <= n <= 16 | 1 <= r <= n *2048-16 | RECSIZE | ||
DATA(4K) | 2 <= n <= 16 | ||||
U | PAMKEY | 1 <= n <= 16 | BLKSIZE | ||
DATA(2K) | 1 <= n <= 16 | BLKSIZE - 16 | |||
DATA(4K) | 2 <= n <= 16 | ||||
PAM | PAMKEY | 1 <= n <= 16 | BLKSIZE | ||
DATA(2K) | 1 <= n <= 16 | BLKSIZE - 12 | |||
DATA(4K) | 2 <= n <= 16 | ||||
NO(2K) | 1 <= n <= 16 | BLKSIZE | |||
NO(4K) | 2 <= n <= 16 | ||||
ISAM1) | V | PAMKEY | 1 <= n <= 16 | 5 <= r <= n *2048 | RECSIZE - 4 |
DATA(2K) | 1 <= n <= 16 | 5 <= r <= n *2048 | RECSIZE - 4 | ||
DATA(4K) | 2 <= n <= 16 | ||||
F | PAMKEY | 1 <= n <= 16 | 1 <= r <= n *2048-4 | RECSIZE | |
DATA(2K) | 1 <= n <= 16 | 1 <= r <= n *2048-4 | RECSIZE | ||
DATA(4K) | 2 <= n <= 16 |
1) | The default attributes for the key position (for record format V = 5 and for F = 1) and key length (8) can be modified to a maximum of 32767 and 255, respectively. Multiple keys can also be defined ( In contrast to stream-oriented I/O, the ISAM keys are a part to the record data that is written or read by the C program. |