IMS DB Characterstics

  • An IMS database consists of many number of database records.
  • The size of the database is limited by the constraint of VSAM and DASD.
  • A maximum of 15 levels are allowed.
  • A level can be defined as all segments that have the same number of segments above them.
  • The root segment is always level one.
  • Each immediate child of the root is level two and the child of level two is level three and so on.
  • IMS allows up to 255 different segment types in single database.
  • The sequential processing of an IMS Hierarchy is always top-to-bottom, left-to-right.

Database Positioning

IMS keeps track of its current position in the database after each operation. This positioning is crucial for sequential processing.​

  • Before the first call, the position is prior to the first root segment.
  • After any read/ write, the position is after the segment just processed.
  • The database position needs to be remembered when processing a database sequentially.
  • IMS read moves only forward, no backward.

Example:

  • Before any operation, IMS is positioned before the first Company.
  • After reading Company A, it's positioned before Project X.
  • After reading Employee 2, it's positioned before Employee 3.

Forward-Only Navigation

IMS processes data in a forward-only manner. Once it moves past a segment, it cannot go back unless the program resets the position. If the program tries to find the segment already processed, IMS will not find the segment.

Example:

  • If you've read Employee 2 and moved to Employee 3, you can't go back to Employee 2 without restarting the traversal.