Segment prefix information for logical relationships

You should be aware of two things regarding the prefix of a segment involved in a logical relationship.

First, IMS places pointers in the prefix in a specific sequence and, second, IMS places a counter in the prefix for logical parents that do not have logical child pointers.

Sequence of pointers in a segment's prefix

When a segment contains more than one type of pointer and is involved in a logical relationship, pointers are put in the segment's prefix in the following sequence:

  1. HF
  2. HB
  3. PP
  4. LTF
  5. LTB
  6. LP

Or:

  1. TF
  2. TB
  3. PP
  4. LTF
  5. LTB
  6. LP
  7. PCF
  8. PCL

Or:

  1. TF
  2. TB
  3. PP
  4. PCF
  5. PCL
  6. EPS

Multiple PCF and PCL pointers can exist in a segment type; however, more than one of the other types of pointers can not.

Counter used in logical relationships

IMS puts a 4-byte counter in all logical parents that do not have logical child pointers. The counter is stored in the logical parent's prefix and contains a count of the number of logical children pointing to this logical parent. The counter is maintained by IMS and is used to handle delete operations properly. If the count is greater than zero, the logical parent cannot be deleted from the database because there are still logical children pointing to it.