Standard File Header

The first record in every variable structure file is a system record called the file header. This is normally 128 bytes in length and takes the following form:

Offset Size Description
0 4 Length of the file header. The first 4 bits are always set to 3 (0011 in binary) indicating that this is a system record. The remaining bits contain the length of the file header record. If the maximum record length is less than 4095 bytes, the length is 126 and is held in the next 12 bits; otherwise it is 124 and is held in the next 28 bits. Hence, in a file where the maximum record length is less than 4095 bytes, this field contains x"30 7E 00 00". Otherwise, this field contains x"30 00 00 7C".
4 2 Database sequence number, used by add-on products.
6 2 Integrity flag. Indexed files only. If this is non-zero when the header is read, it indicates that the file is corrupt.
8 14 Creation date and time in YYMMDDHHMMSSCC format. Indexed files only.
22 14 Reserved.
36 2 Reserved. Value 62 decimal; x"00 3E".
38 1 Not used. Set to zeros.
39 1 Organization:
  1. Sequential
  2. Indexed
  3. Relative
40 1 Not used. Set to zeros.
41 1 Data compression routine number:
0
No compression
1
CBLDC001
2-127
Reserved for internal use
128-255
User-defined compression routine number
42 1 Not used. Set to zeros.
43 1 Indexed files only - type of indexed file. See the topic Types of Indexed File .
44 4 Reserved.
48 1 Recording mode:
0
Fixed format
1
Variable format

For indexed files, the recording mode field of the .idx file takes precedence.

49 5 Not used. Set to zeros.
54 4 Maximum record length. Example: with a maximum record of length 80 characters, this field will contain x"00 00 00 50".
58 4 Minimum record length. Example: with a minimum record length of 2 characters, this field will contain x"00 00 00 02".
62 46 Not used. Set to zeros.
108 4 Version and build data for the indexed file handler creating the file. Indexed files only.
112 16 Not used. Set to zeros.