Product Documentation

Knowledgebase

Previous Topic

Next Topic

Fixed-Length Parameter File Examples

The contents of ctexam.p will be similar to those shown below.

ISAM Parameter File for Fixed Record Length

18 3 4 1

3 cust.dat 128 4096 1 3

0 custnam.idx 24 0 0 1 4096 1 1 32 3

6 14 2

30 6 2

121 4 3

1 4 0 0 0 0 1

2 4 1

2 custzip.idx 22 0 0 0 4096 1 1 32 3

112 9 2

6 9 2

121 4 3

This parameter file is interpreted as follows. There will be eighteen index file buffers, up to three index files, 512-byte B-Tree nodes, and exactly one data file.

The first index is assigned key number 0, and is in the file named custnam.idx which will be incremented in 4,096-byte chunks. The keys are unique, 24 bytes long and scanned left-to-right. The keys have three segments: 14 bytes, 6 bytes and 4 bytes long. The first two segments are converted to upper case, and are made up of the last name and first, respectively. The third segment is based on the automatic sequence number maintained by FairCom DB for each data file. The sequence number ensures that keys, which are otherwise the same, will be stored in order of entry in the data base.

Note: FairCom DB automatically places the sequence number in the record at byte offset 121 as specified by the third segment’s offset value.

The second index is assigned key number 1, and is the first (and only) additional member of custnam.idx. The keys are unique, 4-byte values. Keys are not checked for missing values (i.e., all data records will generate a key value). The key is comprised of one segment treated as an unsigned integer.

The last index is assigned key number 2, is named custzip.idx and has 22-byte unique keys. The key segments are made up of the nine character Zip Code, the first 9 bytes of the last name, and the same automatic sequence number used in the name index.

Note: If more than one index uses the automatic sequence number, all such indexes must use the same sequence number. Otherwise, the results will be unpredictable. The segment length of the sequence number must be 4.

Note: Each data file, index file, and index file member is assigned a unique number. This is the number by which the data file and indexes are referenced in the FairCom DB functions. The additional index members are numbered consecutively based on the host index number.

If RTREE is enabled in ctoptn.h, the preceding parameter file might look as follows:

ISAM Parameter File with RTREE Enabled

18 3 4 1

3 cust.dat 128 4096 1 3 delflag cust_last

0 custnam.idx 24 0 0 1 4096 1 1 32 3 name_key

6 14 2

30 6 2

121 4 3

1 4 0 0 0 0 1 numb_key

2 4 1

2 custzip.idx 22 0 0 0 4096 1 1 32 3 zipc_key

112 9 2

6 9 2

121 4 3

TOCIndex