HDAM, HIDAM, PHDAM, or PHIDAM database

HDAM, HIDAM, PHDAM, and PHIDAM databases share the following record format.

Segment Format

The following figure shows the segment format of HDAM, HIDAM, PHDAM, and PHIDAM databases.

Figure 1. HDAM, HIDAM, PHDAM, or PHIDAM segment format
Graphic is 5 column, 1 row table. Column 1 is labeled "SEG. CODE" and is 1 byte. Column 2 is labeled "DEL. FLAG" and is 1 byte. Column 3 is labeled "COUNTER AND POINTERS AREA" and has an unlabeled arrow spanning the length of the column. Also, columns 1 through 3 are designated "PREFIX." Column 4 is labeled "DATA." Column 5 is labeled "SEE NOTE." Also, columns 4 and 5 are designated "DATA."

In order for all segments to be half-word-aligned, a slack byte is added to the end of any segment whose length is an odd number.

Prefix of a Segment
The following figure maps the prefix of a segment.
Figure 2. Mapping the prefix of a segment
Graphic is 2 rectangles. Rectangle 1 is above rectangle 2. Rectangle 1 is divided into 2 smaller rectangles of equal length inside of it. The left smaller rectangle is labeled "Prefix" and the right smaller rectangle is labeled "Data." Rectangle 2 is divided into 13 smaller rectangles. Rectangle 1 is labeled "S"; 2 is labeled "D"; 3 is labeled "CTR"; 4 is labeled "PTF"; 5 is labeled "PTB"; 6 is labeled "PP"; 7 is labeled "LTF"; 8 is labeled "LTB"; 9 is labeled "LP"; 10 is labeled "LCF"; 11 is labeled "LCL"; 12 is labeled "PCF"; 13 is labeled "PCL." Rectangles 3 through 9 reference note 1. Rectangles 10 and 11 reference note 2. Rectangles 12 and 13 reference note 3.
Notes to Figure 2:
1.
Prefix Flag
Prefix Flag Description
 
Segment code (S)
 
Delete flag (D)

The pointers that exist in this section of the prefix are identified in the PSDB field DMBPTR, as shown in the following list:

X'80'
Counter (CTR) for logical relationships
X'40'
Physical twin forward (PTF)
X'20'
Physical twin backward (PTB)
X'10'
Physical parent (PP)
X'08'
Logical twin forward (LTF)
X'04'
Logical twin backward (LTB)
X'02'
Logical parent (LP)
X'01'
Hierarchical direct pointing (For twin-type pointing, this bit is off)
2.
How to locate all logical children: logical child first (LCF); logical child last (LCL)
a.
At DMBFLAG, if flag DMBLCEX (X'20') is on, then DMBLST points to a secondary list for this segment. Secondary lists are used for information concerning indexes, logical children, or the logical parents.
b.
Secondary list entries whose field DMBSCDE (SEC+0) has flag DMBSLC (X'02') on are descriptions of logical children for a logical parent. Within these secondary lists, the field DMBSLCFL (X'02') has the number of the first and last logical child pointers in the prefix of the logical parent.
c.
A logical parent can have multiple types of logical children; thus, there can be more than one logical child secondary list entry for a logical parent. The last secondary list for each segment has the DMBSND flag (X'80') set on in the field DMBSCDE (SEC+0).
3.
How to locate all physical children: physical child first (PCF); physical child last (PCL)
a.
Physical child pointers are only present if this segment uses twin-type pointing rather than hierarchic-type pointing. The PSDB entries for the children of the segment being mapped indicate the number of the pointer in the prefix of the parent segment which points to the first and last occurrence of the child segments.
b.
The PSDB fields DMBPPFD and DMBPPBK are used for these numbers. The PSDB entries for the children of the segment being mapped can be found by scanning the PSDBs for those segments with a parent segment code (PSDB+1) that matches the segment code (PSDB+0) of the segment being mapped.
4
An EPS (extended pointer set) that is 28 bytes in length is present in the prefix of an LC segment prefix of a HALDB.
5
An ILK (indirect list entry key) that is 8 bytes in length is present in each segment of a PHIDAM or PHDAM.