The segment
A database record consists of one or more segments, and the segment is the smallest piece of data IMS can store.
Here are some additional facts you need to know about segments:
- A database record can contain a maximum of 255 segment types. The space you allocate for the database limits the number of segment occurrences.
- You determine the length of a segment; however, a segment cannot be larger than the physical record length of the device on which it is stored.
- The length of segments is specified by segment type. A segment type can be either variable or fixed in length.
Segments consist of two parts (a prefix and the data), except when using a SHSAM or SHISAM database. In SHSAM and SHISAM databases, the segment consists of only the data. In a GSAM database, segments do not exist.
The following figure shows the format of a fixed-length segment.

The following figure shows the format of a variable-length segment.

IMS uses the prefix portion
of the segment to manage
the segment. The prefix portion of
a segment consists of: segment code, delete byte, and in some databases,
a pointer and counter area. Application programs do not see
the
prefix portion of a segment. The data portion of a segment contains
your data, arranged in one or more fields.