The input/output functions of the C runtime system can process disk files with the file attributes listed in the following tables. The default attributes which the runtime system inserts if the user does not specify any options in the ADD-FILE-LINK command or in the open functions are underlined.
Notes on Tables 1 to 3
The maximum number of data bytes in the following 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 data volume (see also "K and NK block formats").
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).Please also refer to section “K and NK block formats” for information on the block format (BLKCTRL) and the maximum number of data bytes.
In particular, you will learn how to avoid overflow blocks with NK-ISAM files which occur if the full length of a transfer unit is utilized when writing the 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, RECSIZE (RECORD-SIZE parameter in the ADD-FILE-LINK command) determines the register in which the length of a record is passed. This register is predefined (R4) and must not be changed.
Table 1: File attributes of text files for stream-oriented input/output
FCB- | REC- | BLKCTRL | BLKSIZE | RECSIZE | Max. number |
SAM1) | V | PAMKEY | 1 | 4 | RECSIZE - 4 |
DATA(2K) | 1 | 4 | RECSIZE - 4 | ||
DATA(4K) | 2 | ||||
U | PAMKEY | 1 | BLKSIZE | ||
DATA(2K) | 1 | BLKSIZE - 16 | |||
DATA(4K) | 2 | ||||
ISAM2) | V | PAMKEY | 1 | 12 | RECSIZE - 12 |
DATA(2K) | 1 | 12 | RECSIZE - 12 | ||
DATA(4K) | 2 |
1) | In KR mode SAM files are created by default (KR mode applies to C/C++ versions prior to V3.0 only). |
2) | The default value for the key position is 5, and the default key length is 8. These values cannot be modified. |
Table 2: File attributes of binary files for stream-oriented input/output
FCB- | REC- | BLKCTRL | BLKSIZE | RECSIZE | Max. number |
SAM | F | PAMKEY | 1 | 1 | RECSIZE |
DATA(2K) | 1 | 1 | RECSIZE | ||
DATA(4K) | 2 | ||||
V | PAMKEY | 1 | 4 | RECSIZE - 4 | |
DATA(2K) | 1 | 4 | RECSIZE - 4 | ||
DATA(4K) | 2 | ||||
U | PAMKEY | 1 | BLKSIZE | ||
DATA(2K) | 1 | BLKSIZE - 16 | |||
DATA(4K) | 2 | ||||
PAM | PAMKEY | 1 | BLKSIZE | ||
DATA(2K) | 1 | BLKSIZE - 12 | |||
DATA(4K) | 2 | ||||
NO(2K) | 1 | BLKSIZE | |||
NO(4K) | 2 |
Table 3: File attributes of binary files for record-oriented input/output
FCB- | REC- | BLKCTRL | BLKSIZE | RECSIZE | Max. number |
SAM | V | PAMKEY | 1 | 4 | RECSIZE - 4 |
DATA(2K) | 1 | 4 | RECSIZE - 4 | ||
DATA(4K) | 2 | ||||
F | PAMKEY | 1 | 1 | RECSIZE | |
DATA(2K) | 1 | 1 | RECSIZE | ||
DATA(4K) | 2 | ||||
U | PAMKEY | 1 | BLKSIZE | ||
DATA(2K) | 1 | BLKSIZE - 16 | |||
DATA(4K) | 2 | ||||
PAM | PAMKEY | 1 | BLKSIZE | ||
DATA(2K) | 1 | BLKSIZE - 12 | |||
DATA(4K) | 2 | ||||
NO(2K) | 1 | BLKSIZE | |||
NO(4K) | 2 | ||||
ISAM1) | V | PAMKEY | 1 | 5 | RECSIZE - 4 |
DATA(2K) | 1 | 5 | RECSIZE - 4 | ||
DATA(4K) | 2 | ||||
F | PAMKEY | 1 | 1 | RECSIZE | |
DATA(2K) | 1 | 1 | RECSIZE | ||
DATA(4K) | 2 |
1) | The default attributes for key position (for record format V = 5, F = 1) and key length (8) can be modified up to 32767 and 255 respectively. Multiple keys can also be defined (DUP-KEY=Y). The default value is DUP-KEY=N. In contrast to stream-oriented input/output, the ISAM keys belong to the record data which is written from the C program or read into the C program. |