Product Documentation

Knowledgebase

Previous Topic

Next Topic

Variable-Length Parameter File Example

The example parameter file for the variable-length example takes advantage of the key compression and the variable-length fields supported by FairCom DB. ctvxam.p is the associated parameter file. The contents of ctvxam.p will be similar to those shown below (assuming RTREE is not enabled).

ISAM Parameter File For Variable Record Length

18 3 4 1

3 vcust.dat 15 4096 5 3

0 vcust.idx 24 4 1 2 4096 1 0 32 2

0 15 5

4 5 2

1 4 0 0 0 0 1

0 4 1

2 22 12 1 1 32 2

4 9 2

0 9 5

The important points to note in this example are:

  • The last name index (keyno = 0) has a key type of 4 (leading character compression will take place). Padding compression is not used since the second segment of the key is based on the Zip Code and will usually be the full length.
  • The first segment of the last name index has a mode value of 5. The segment is found in the zeroth varying length field, right after the fixed-length portion of each data record, not at absolute byte position zero. It will be padded, if necessary, to 15 bytes, and converted to upper case.
  • The Zip Code index (keyno = 2) has a key type of 12 (both leading character and padding compression will take place). Since the second segment of this index is based on the last name, many of the keys should have padding.

The main differences between ctvxam.p and ctexam.p are:

  • The data file uses variable-length records, (file mode of 5 specifies virtually opened, variable-length records, and file sharing in multi-user systems), with a minimum record length of 15 bytes;
  • All the indexes have been combined into one physical index file;
  • The key segment offsets are modified since all the fixed-length fields have been moved to the beginning of the record structure.

These examples use a non-zero file size extension parameter. A zero file size extension parameter means the file grows one record at a time instead of growing in large chunks. The advantage of growing in chunks is that every time the file is extended, FairCom DB forces the update of directory entries associated with the file.

TOCIndex