Variable length segment structure


The following figure depicts a variable length segment (VLS) that can exist in HISAM, HDAM, and HIDAM databases; a description of the structure immediately follows the figure.

GUID-B4329D7C-5EF2-4DAE-B736-27F175CC38B2-low.png

Segment code

See the definition for the appropriate database organization.

Delete byte

See the definition for the appropriate database organization.

Counters and pointers

See the definition for the appropriate database organization.

Variable length field

2 bytes. Signed binary number that specifies the length of the data portion of the segment, including the variable length field itself.

Data

See the definition for the appropriate database organization.

If a variable length segment in a HISAM database is replaced and is longer than it was before, IMS will move the following segments to make room for the new segment. IMS does not move HDAM and HIDAM database segments once they have been inserted. Instead, it splits the segment, leaving the prefix part in the original location and inserting the data part in another location. The two parts are connected by a VLS pointer.

You can make a segment variable in length in one of two ways:

  • By specifically defining it to be variable in length via the SIZE= operand in the SEGM macro of the DBD
  • By implicitly defining it to be variable length via the COMPRTN= operand in the SEGM macro of the DBD

Thus, use of a compression routine always makes the segment variable in length in the data, but may be presented to the user through a DL/I call as fixed length. How the user sees the segment data is determined by the SIZE= parameter in the DBD.

Split variable length segment structure

GUID-F39D883D-86F2-4D06-ACBD-147653C3DE0C-low.png

Prefix

The prefix consists of the segment code, delete byte, counters and pointers, VLS pointer, and free space.

Segment code

See the definition for the appropriate database organization.

Delete byte

See the definition for the appropriate database organization. BIT 4 will be on, indicating that the prefix and data are separated. Typically this will be X'08'.

Counters and pointers

See the definition for the appropriate database organization.

VLS pointer

4 bytes. RBA of the data part of the variable length segment.

Free space

Normal IMS free space (described in a later section of this section).

Data

The data portion consists of the segment code, delete byte, a variable length field, and data.

Segment code

See the definition for the appropriate database organization.

Delete byte

This will always be X'FF'.

Variable length field

2 bytes. Signed binary number that specifies the length of the data portion of the segment, including the variable length field itself.

Data

See the definition for the appropriate database organization.


Related topic


 

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