HDAM/HIDAM segment structure


This topic provides information on the HDAM/HIDAM segment structure.

The following figure shows this structure; a description of the structure immediately follows the figure.

GUID-7A05AE14-6CC9-469F-BB3B-05990B75F537-low.png

Segment code

1 byte. The segment code byte contains a one-byte unsigned binary number which is unique to the segment type within the database. The segments are numbered in hierarchical order starting at 1 and ending with 255 (X'01' through X'FF').

Delete byte

1 byte. The delete byte contains a set of flags as follows:

  • BIT 0

    This bit is always zero.

  • BIT 1

    This bit is always zero.

  • BIT 2

    This bit on indicates that the segment has been processed by the IMS delete routine.

  • BIT 3

    This bit is reserved for future use and should always be binary zero.

  • BIT 4

    This bit on indicates that it is a variable length segment, and the data and prefix are separated.

  • BIT 5

    This bit on indicates that the segment has been deleted from its physical path. IMS uses this bit only if the segment is involved in a logical relationship and can be accessed from a logical path that is not through its physical parent. With this bit on, it is still possible to access this segment through a logical path.

  • BIT 6

    This bit on indicates that the segment has been deleted from its logical path. IMS uses this bit only if the segment is involved in a logical relationship and can be accessed from a logical path that is not through its physical parent. With this bit on, it is still possible to access this segment through a physical path.

  • BIT 7

    This bit on indicates that the segment is to be removed from its logical twin chain. Bits 5 and 6 must be on for this flag to be on.

Counters and pointers

The following four-byte fields can be in this area, and if present, they will occur in the order indicated below.

  • Counter

    If the segment has a logical relationship which is unidirectional or bidirectional with physical pairing, then a four-byte counter will exist.

  • Hierarchical or Physical Twin Pointers

    A hierarchical forward pointer or a twin forward pointer must be present in the segment prefix, unless PTR=NOTWIN was specified in the SEGM statement. Hierarchical backward pointers or twin backward pointers can also be present (PTR=HB or PTR=TB on SEGM statement).

  • Physical Parent Pointer

    This pointer will be present if the segment is a logical child or has a logical child below it in the hierarchy. It will also be generated if the segment is a logical parent or has a logical parent below it in the hierarchy.

    It is also present in any segments which are target segments for a secondary index or lie on the hierarchical paths between the root segment and any target segments.

  • Logical Twin Pointers

    A logical twin forward pointer and a logical twin backward pointer will only exist in a logical child segment that has a bidirectional logical relationship that is virtually paired. A logical twin backward pointer will be present if LTWINBWD is specified on the SEGM statement of the logical child segment.

  • Logical Parent Pointer

    A logical child segment can have a direct pointer to its logical parent (PHYSICAL specified on SEGM statement) if the logical parent is in an HD database.

  • Logical Child Pointers

    If the segment is a logical parent and has one or more logical relationships that are bidirectional with virtual pairing, then for each relationship there will be a four-byte RBA pointer to the first logical child segment (a logical child first pointer). There can also be a four-byte RBA pointer to the last logical child segment (a logical child last pointer), depending on whether SNGL or DBLE is specified on the LCHILD statement. The pointers will be in the order that the logical relationships are defined in the DBD, with a logical child first pointer before a logical child last pointer.

  • Physical Child Pointers

    If physical pointers rather than hierarchical pointers have been chosen for the segment, there will be a four-byte RBA pointer to the first physical child segment (a physical child first pointer). There can also be a four-byte RBA pointer to the last physical child segment (a physical child last pointer). The pointers will be in the order that the physical children are defined in the DBD, with a physical child first pointer before a physical child last pointer.

    The following figure shows a logical parent with unidirectional relationships, two bidirectional virtually paired relationships (the second with backward pointers), and three physical segments (the second with backward pointers).

Example counter and pointers in a typical HD-type segment

GUID-C40373D6-1EAB-4AE2-ACD3-98C2BE347985-low.png

Data

The length of the data area can be a fixed length that is specified in the DBD or variable length (described in Variable-length-segment-structure). For a logical child segment with symbolic keys (PARENT=PHYSICAL on the SEGM statement), the concatenated key of the logical parent will be at the start of the segment.

Data pad

If the segment length is an odd number of bytes, a one-byte pad will be appended to the segment to ensure that all segments start on half word boundaries.


Related topic


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*