The join is an important technique for reporting from any database system. A join enables you to report from more than one database at the same time by matching values of fields from each database.
With most FOCUS Interfaces, you can join separate databases or files that share a common field by describing each file as a segment in one multi-structure Master File. This embedded join technique is not available with the IMS/DB Interface since each Master File must describe one PCB and each PCB must describe one DBD.
The following sections describe the techniques available for relating separate IMS databases.
In IMS, a PCB can describe a logical database, and a logical DBD can describe a relationship between multiple IMS databases. Therefore, a Master File can describe a join between separate IMS databases if there is a PCB for a DBD that describes the join.
The Interface cannot distinguish between a DBD for a physical database and a DBD for a logical database. You create the Master Files using identical techniques and attributes.
The PSB provides the ability to report from separate IMS databases. The PSB can contain PCBs for multiple databases, and an application can use all PCBs from a PSB. However, this is not a join since there is no automatic matching of common field values from the separate databases and, in fact, the databases do not have to be related in any way.
The Interface provides the dynamic JOIN command for joining separate databases. You can issue a JOIN command at run time to join IMS databases that have PCBs in the same PSB. In fact, with the appropriate Interfaces installed, you can implement joins between IMS databases and non-IMS databases or files (for example, DB2 tables, MODEL 204 files, and FOCUS databases).
The databases to be joined must have at least one field that shares common values. In order to join "to" an IMS database, you must join to a key field or secondary index in the root segment.
The following diagram illustrates a dynamic join between separate IMS databases:
Information Builders |