IMS DB Segment

A segment is the smallest unit of data that an application can retrieve or manipulate. Each segment comprises one or more fields, which are individual data items. Segments are organized hierarchically, forming a tree-like structure where each segment (except the root) has a parent segment.

IMSDB Structure Example: Imagine a company's organizational chart. At the top is the CEO (root segment), under whom are department heads (child segments), and under them are team members (further child segments).

Hierarchical Database Structure

Segment Types

Segment can be of different categories based on the information of it contains. Segment can be of 255 types in the IMS database. In the above example, company, employee & projects are the segment types.

Root Segment

The Root Segment is the topmost segment in the IMS database hierarchy. It's the entry point through which all other segments are accessed. There is only one root segment per database, and it is never a child of any other segment.

Example: In a company database, the Company segment would be the root segment.

Parent Segment

A Parent Segment is any segment that has one or more child segments directly beneath it in the hierarchy. It serves as a container for its child segments.

Example: The Project segment is a parent to the Employee segment.​

Dependent Segment

A Dependent Segment is any segment that is not the root. It relies on a parent segment to provide context and meaning.

Example: The Employee segment is dependent on the Project segment.​

Child Segment

A Child Segment is a specific type of dependent segment that is directly beneath a parent segment in the hierarchy.

Example: The Employee segment is a child of the Project segment.​

Twin Segments

Twin Segments are multiple occurrences of the same segment type under a single parent segment. They represent different instances of similar data..

Example: Multiple Employee segments under the same Project segment are twin segments.

Sibling Segments

Sibling Segments are segments of different types that share the same parent segment. They are at the same hierarchical level but represent different kinds of data.

Example: If a Project segment has both Employee and Budget segments beneath it, then Employee and Budget are sibling segments.

Segment Levels

IMS allows up to 15 levels in its hierarchy. Each level represents a depth in the tree, starting from the root at level 1.

Example:

  • Level 1: Company
  • Level 2: Project
  • Level 3: Employee

This means you can model complex organizations with multiple layers, such as departments within projects or teams within departments.

Segment Occurrence

Segment occurrence is the number of occurrences of segment type. In the database, the segment type should be only one. The Segment occurrence can be unlimited.

While each segment type (e.g., Company, Project, Employee) is defined once in the database schema, there can be multiple segment occurrences. This means that:

  • A single company can have multiple projects.
  • Each project can have multiple employees.​

Example: "TechCorp" might have two projects: "AI Development" and "Cloud Migration". "AI Development" could have employees "John Doe" and "Jane Smith", while "Cloud Migration" has "Alice Brown".