Inserting dependent segments

Dependent segments inserted into a HISAM database after initial load are inserted in hierarchical sequence. IMS decides where in the appropriate logical record the new dependent should be inserted.

Two situations are possible. Either there is enough space in the logical record for the new dependent or there is not.

The following figure shows how segment insertion takes place when there is enough space in the logical record. The new dependent is stored in its proper hierarchical position in the logical record by shifting the segments that hierarchically follow it to the right in the logical record.

Figure 1. Inserting a dependent segment into a HISAM database (space exists in the logical record)
Before: Logical record has Root14, DepA, DepD, and free space. After inserting DepB: Logical record has Root14, DepA, DepB, and DepD.

The following figure shows how segment insertion takes place when there is not enough space in the logical record. As in the previous case, new dependents are always stored in their proper hierarchical sequence in the logical record. However, all segments to the right of the new segment are moved to the first empty logical record in the overflow data set.

Figure 2. Inserting a dependent segment into a HISAM database (no space exists in the logical record)
Logical record for Root14 dependents in overflow data set has DepF, DepH, and DepI. After inserting DepG, that record has DepF and DepG. A pointer points to logical record with DepH and DepI.