IMS DB Fields

Fields are the fundamental data elements within segments in an IMS database. Each segment comprises one or more fields, and these fields are categorized into three types: Sequence (Key) Fields, Search Fields, and Undefined Fields.

Sequence (Key) Field

A Sequence Field, also known as a Key Field, uniquely identifies a segment occurrence under a parent segment. IMS uses this field to maintain the order of segment occurrences and to facilitate direct access to specific segments.

Example:

  • Company Segment: Field: Company_Code (e.g., "C001"). Uniquely identifies each company.​
  • Project Segment: Field: Project_Code (e.g., "P1001"). Uniquely identifies each project under a company.​
  • Employee Segment: Field: Employee_ID (e.g., "E123"). Uniquely identifies each employee under a project.​

By defining these key fields, IMS can maintain an ordered structure, such as listing all employees under a project in ascending order of their Employee_ID.

Search Field

A Search Field is defined in the Database Description (DBD) and allows IMS to search for segments based on specific field values. Unlike key fields, search fields are not used to sequence segment occurrences but to filter and retrieve segments that match certain criteria.

Example:

  • Employee Segment: Field: Employee_Name (e.g., "John Doe"). Allows retrieval of employee segments where the name matches "John Doe".
  • Project Segment: Field: Project_Name (e.g., "AI Development"). Enables searching for projects with the name "AI Development".​

By defining Employee_Name and Project_Name as search fields, applications can efficiently locate specific employees or projects without scanning the entire database. ​

Undefined Field

An Undefined Field is a field within a segment that is not explicitly defined in the DBD. IMS does not recognize these fields for searching or sequencing purposes. Their format and usage are determined by the application programs that process the database.

Example:

  • Employee Segment: Field: Employee_Address (e.g., "123 Main St").

In this case, Employee_Address is an undefined field. IMS treats it as opaque data, and its interpretation is left to the application logic.