How secondary indexes restructure the hierarchy of full-function databases
When the PROCSEQ= parameter in the PCB is coded to specify that the application program needs to do processing using the secondary index, the way in which the application program perceives the database record changes.
If the target segment is the root segment in the database record, the structure that the application program perceives does not differ from the one it can access using the regular processing sequence. However, if the target segment is not the root segment, the hierarchy in the database record is conceptually restructured. The following figures illustrate this concept.
The target segment (as shown in Figure 1) is segment G. Target segment G becomes the root segment in the restructured hierarchy (as shown in Figure 2). All dependents of the target segment (segments H, J, and I) remain dependents of the target segment. However, all segments on which the target is dependent (segments D and A) and their subordinates become dependents of the target and are put in the leftmost positions of the restructured hierarchy. Their position in the restructured hierarchy is the order of immediate dependency. D becomes an immediate dependent of G, and A becomes an immediate dependent of D.


This new structure is called a secondary data structure. A processing restriction exists when using a secondary data structure, and the target segment and the segments on which it was dependent (its physical parents, segments D and A) cannot be inserted or deleted.
Secondary processing sequence
The restructuring of the hierarchy in the database record changes the way in which the application program accesses segments. The new sequence in which segments are accessed is called the secondary processing sequence. Figure 2 shows how the application program perceives the database record.
If the same segment is referenced more than once (as shown in Figure 2), you must use the DBDGEN utility to generate a logical DBD that assigns alternate names to the additional segment references. If you do not generate the logical DBD, the PSBGEN utility issues the message SEG150 for the duplicate SENSEG names.