Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Default values and permissible modifications of the file attributes

&pagelevel(4)&pagelevel

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-
TYPE

REC-
FORM

BLKCTRL

BLKSIZE
(STD,n)

RECSIZE
(r byte)

Max. number
of data bytes

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)

In KR mode SAM files are created by default (KR mode applies to C/C++ versions prior to V3.0 only).
In ANSI mode, ISAM files are created by default.

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 system: when a new ISAM file is created the first record is assigned the key "00010000" and the key is incremented in steps of 100 for each further record.

Table 2: File attributes of binary files for stream-oriented input/output

FCB-
TYPE

REC-
FORM

BLKCTRL

BLKSIZE
(STD,n)

RECSIZE
(r byte)

Max. number
of data bytes

SAM

F

PAMKEY

1<= n <=16

1<= r <=n*2048

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 3: File attributes of binary files for record-oriented input/output

FCB-
TYPE

REC-
FORM

BLKCTRL

BLKSIZE
(STD,n)

RECSIZE
(r byte)

Max. number
of data bytes

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

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 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.