HISAM segment structure
This topic provides information on the HISAM segment structure.
Figure 1 shows this structure; a description of the structure immediately follows the figure.
Figure 1. HISAM segment structure

Segment code | 1 byte. The segment code byte contains a one-byte unsigned binary number which is unique to the segment type within the database. The segments are numbered in hierarchical order starting at 1 and ending with 255 (X'01' through X'FF'). |
|---|---|
Delete byte | 1 byte. The delete byte contains a set of flags as follows:
|
Counters and pointers | The appearance of this area depends on the logical relationship status of the segment:
If the segment is a logical parent and has one or more logical relationships which are bidirectional with virtual pairing, then for each relationship there will be a four-byte RBA pointer to the first logical child segment (a logical child first pointer) and, optionally, a four-byte RBA pointer to the last logical child segment (a logical child last pointer), depending on whether SNGL or DBLE is specified on the LCHILD statement. There will be only one counter in a segment, but there can be multiple logical child first and logical child last pointers. The counter will precede the pointers. The pointers will be in the order that the logical relationships are defined in the DBD with a logical child first pointer before a logical child last pointer. The following figure shows this type of segment. Figure 2. Multiple logical child pointers in a segment
|
Data | The length of the data area can be a fixed length (which is specified in the DBD) or a variable length (described in Variable-length-segment-structure). For a logical child segment with symbolic keys (PARENT=PHYSICAL on the SEGM statement), the concatenated key of the logical parent will be at the start of the segment. If the segment is variable length, the first two bytes of the data area are a binary number which represents the length of the data area including the two-byte length. |
