Hierarchical forward and backward pointers

With hierarchical forward and backward pointers (HF and HB), each segment in a database record points to both the segment that follows and the one that precedes it in the hierarchy (except dependent segments do not point back to root segments).

HF and HB pointers must be used together, since you cannot use HB pointers alone. The following figure shows how HF and HB pointers work.

Figure 1. Hierarchical forward and backward pointers
Labelled boxes represent the segments of a database record. Lines with arrows at each end represent the HF and HB pointers and link all of the dependent segments in sequence.

HF pointers work in the same way as the HF pointers that are described in Hierarchical forward pointers.

HB pointers point from a segment to one immediately preceding it in the hierarchy. In most cases, HB pointers are not required for delete processing. IMS saves the location of the previous segment retrieved on the chain and uses this information for delete processing. The backward pointers are useful for delete processing if the previous segment on the chain has not been accessed. This happens when the segment to be deleted is entered by a logical relationship.

The backward pointers are useful only when all of the following are true:

Eight bytes are needed in each dependent segment's prefix to contain HF and HB pointers. Twelve bytes are needed in the root segment. More bytes are needed in the root segment because the root points:

If you are defining your database with DBD generation macro statements, HF and HB pointers are specified by coding PTR=HB in the SEGM statement in the DBD.

If you are defining your database by using DDL statements, HF and HB pointers are specified by coding the HIERBWD parameter in a CREATE or ALTER TABLE statement.

Restriction: HALDB databases do not support HF and HB pointers.