In this topic, we described about the below sections -
There are three types of fields in the segments of an IMS-DL/I database
- Key(Sequence) field
- Search field
- Undefined field
Sequence (Key) Field:
Unique identifier of a segment. The sequence field referred to as the key field. Key field can be used to keep occurrences of a segment type under a common parent, based on the data or value entered in this field.
Key fields are the logical relationships and secondary indexes of the database. The key field not only can contain data but also can be used in special ways that help you organize the database.
IMS will store the records in ascending numerical order. The fields can be sorted in alphabetical order by defining the name field as a unique key field. The data or value in the key field is called the key of the segment.
The key field can be defined as unique or non-unique. key field not required to define in every segment type. The sequence field is also called as the key field.
It can be used to keep occurrences of a segment type in sequence under a common parent. The above arrangement can be done based on the data or value entered in this field.
A key field can be defined in the root segment of a HISAM, HDAM, or HIDAM database to give direct access to an application program. A key field can be used in HISAM and HIDAM databases to allow database records to be retrieved sequentially.
Key fields are used for logical relationships and secondary indexes. The data or value in the key field is called the key of the segment. The key field can be defined as unique or non-unique.
It is not required to define a key field in every segment type. A sequence field (or key field) is a field that identifies and provides access to segments in a database.
A sequence field is specifies characteristics of a database defined to IMS-DL/I in the Database Description (DBD). A sequence field sequences twin segment occurrences in ascending order based on their sequence field values.
Search field is defined to IMS-DL/I in the DBD. Search field is used to search through the database for particular values. Any filed defined in the database definition.
The application programmer can request IMS to process only segments matching a specific value in the search field. Sequential processing sequences of an IMS database are top-to-bottom, left-to-right.
Undefined field is not defined to IMS-DL/I. All fields other than sequence fields and search fields do not required to be defined in the DBD. IMS DL/I does not aware of the format of an undefined field.
IMS DL/I can’t able to search for undefined fields in the segments. The format of an undefined field is determined by the program that loads the database initially.