How a HIDAM or PHIDAM database is loaded
Root segments in a HIDAM or PHIDAM database must have a unique key field, because an index entry exists for each root segment based on the root's key.
When initially loading a HIDAM or a PHIDAM database, you should present all root segments to the load program in ascending key sequence, with all dependents of a root following in hierarchical sequence. The figure below shows how the two Skills database records shown in Figure 1 appear in storage after initial load. Note that HIDAM and PHIDAM, unlike HDAM and PHDAM, have no root addressable or overflow area, just a series of blocks or CIs.
When database records are initially loaded, they are simply loaded one after another in the order in which they are presented to the load program. The space in the following figure at the end of each block or CI is free space specified when the database was loaded. In this example, 30% free space per block or CI was specified.

Note how segments in a database record are chained together. In this case, hierarchical pointers were used instead of the combination of physical child/physical twin pointers. Each segment points to the next segment in hierarchical sequence. No RAPs exist in the figure above. Although HIDAM databases can have RAPs, you probably do not need to use them.
In storage, a HIDAM or PHIDAM segment consists of a prefix followed by user data. The first byte of the prefix is the segment code, which identifies the segment type to IMS. This number can be from 1 to 255. The segment code is assigned to the segment by IMS in ascending sequence, starting with the root segment and continuing through all dependents in hierarchical sequence. The second byte of the prefix is the delete byte. The third field in the prefix contains the one or more addresses of segments to which this segment is pointing. In this example, hierarchical forward pointers are used. The EDUC6 segment contains only one address, the address of the root segment of the next database record (not shown here) in the database.