Mixing pointers

Because pointers are specified by segment type, the various types of pointers can be mixed within a database record. However, only hierarchical or physical, but not both, can be specified for a given segment type.

The types of pointers that can be specified for a segment type are:

HF
Hierarchical forward
HF and HB
Hierarchical forward and backward
PCF
Physical child first
PCF and PCL
Physical child first and last
PTF
Physical twin forward
PTF and PTB
Physical twin forward and backward

The figure below shows a database record in which pointers have been mixed. Note that, in some cases, for example, dependent segment B, many pointers exist even though only one type of pointer is or can be specified. Also note that if a segment is the last segment in a chain, its last pointer field is set to zero (the case for segment E1, for instance). One exception is noted in the rules for mixing pointers. The figure has a legend that explains what specification in the PTR= or PARENT= operand causes a particular pointer to be generated.

The rules for mixing pointers are:

The following figure shows an example of mixing pointers in a database record.

Figure 1. Mixing pointers
This figure illustrates the rules described in the surrounding text.
Notes for Figure:
  1. These pointers are generated when you specify PTR=H on the root segment.
  2. If you specify PTR=H, usage is hierarchical (H); otherwise usage is twin (T).
  3. These pointers are generated when you specify PTR=T on segment type C and PARENT=SNGL on segment type D
  4. These pointers are generated when you specify PTR=T on segment type C and PARENT=DBLE on segment type E
  5. These pointers are generated when you specify PTR=T on this segment type