Trevor Eddolls Arcati Mainframe Yearbook Virtual IMS Connection IBM Hypnotherapy
         
Bookmark and Share

Monday, 15 March 2010

IMS logical relationships

The latest webinar from Virtual IMS CONNECTION was entitled, "The logical answer: IMS Logical Relationships", and was presented by Aurora Emanuela Dell'Anno, an Engineering Services Architect with CA. Aurora is an IMS and DB2 Specialist Systems Engineer, with a past in application development. Aurora has spent the past 14 years specializing in various aspects of the IBM software world, with particular attention to database management and data warehousing. Keeping pace with the times, the past years have been dedicated to in-depth work on, and study of, data warehousing realities, trouble-shooting systems installations, and application performance issues - this included getting her hands dirty with distributed platforms, customers' implementations, and problem-solving needs in this field, all from the perspective of systems engineering and database administration. Aurora works for CA in the highly-focused Mainframe Solutions Center.

Aurora started her presentation by explaining exactly what an hierarchical database was and what relational data structures were. She then asked why IMS needed logical relationships and suggested the reason was to access segments by a field other than the one chosen as the key, or to associate segments in two different databases or hierarchies. Aurora informed the user group that IMS provides two very useful tools to resolve these data requirements: secondary indexes logical relationships.

Thinking about database design, it can be useful to normalize the data. This helps to break data into naturally associated groupings that can be stored collectively in segments in a hierarchical database. It also breaks individual data elements into groups based on the processing functions, and groups data based on inherent relationships between data elements.

The database types that support logical relationships are HISAM, HDAM, PHDAM, HIDAM, and PHIDAM. There are no logical relationships with Fast Path DEDB or MSDB.

Logical relationships are formed by creating special segments that use pointers to access data in other segments. The path between the logical child and the segment to which it points is called a logical relationship.

There are three types of logical relationships:

  • Unidirectional
  • Bidirectional physically paired
  • Bidirectional virtually paired.

A unidirectional relationship links two segment types (logical child and its logical parent) in one direction. A one-way path is established using a pointer in the logical child.

A bidirectional physically paired logical relationship links two segment types, a logical child and its logical parent, in two directions. A two-way path is established using pointers in the logical child segments.

A bidirectional virtually paired logical relationship is like a bidirectional physically paired relationship. It:

  • Links two segment types, a logical child and its logical parent, in two directions, establishing a two-way path
  • Can be established between two segment types in the same or different databases.

A logical child segment exists in only one database. When going from database A to database B, IMS uses the pointer in the logical child segment. When going from database B to database A, IMS uses the pointer in the logical parent, as well as the pointer in the logical child segment.

To establish a logical relationship, three segment types are always defined - the physical parent, the logical parent, and the logical child.

Aurora explained that the pointers used in logical relationships fall into two categories - direct and symbolic. We can implement logical relationships using both types, however, a direct pointer is a true pointer.

There are four types of pointers:

  • Logical parent (LP)
  • Logical Child (LC)
  • Logical Twin (LT)
  • Physical Parent (PP).

LP pointers point from the logical child to the logical parent. An LP pointer is in the prefix of the logical child and consists of the 4-byte direct address of the logical parent.

Logical child pointers are used only for logical relationships that use virtual pairing. With virtual pairing, only one logical child exists on DASD, and it contains a pointer to a logical parent. The logical parent points to the logical child segment.

Two types of logical child pointers can be used:

  • Logical Child First (LCF)
  • A combination of LCF and Logical Child Last (LCL) pointers.

Because LCF and LCL pointers are direct pointers, the segment they are pointing to must be in an HD database. The logical parent (the segment pointing to the logical child) must be in a HISAM or HD database. If the parent is in a HISAM database, the logical child must use a symbolic pointer to point to the parent.

A symbolic LP pointer consists of the Logical Parent's Concatenated Key (LPCK). It can be used to point into a HISAM or HD database.

Physical Parent (PP) pointers point from a segment to its physical parent. IMS generates PP pointers automatically for HD databases involved in logical relationships.

Logical Child Pointers are used only in logical relationships with virtual pairing. When virtual pairing is used, there is only one logical child on DASD, called the real logical child. This logical child has an LP pointer. The LP pointer can be symbolic or direct.

Two types of logical child pointers can be used:

  • Logical Child First (LCF) pointers
  • A combination of logical child first (LCF) and Logical Child Last (LCL) pointers.

CA's Aurora Dell'Anno went on to inform the user group that logical twins are multiple occurrences of logical child segments that point to the same occurrence of a logical parent segment. Two types of logical twin pointers can be used:

  • Logical Twin Forward (LTF)
  • A combination of LTF and Logical Twin Backward (LTB).

HALDBs (PHDAM, PHIDAM, and PSINDEX databases) use direct and indirect pointers for pointing from one database record to an