To join two FOCUS data sources, you can choose between two types of joins (static and dynamic) and two methods of defining the join (defined in the Master File and defined by issuing the JOIN command).
Among dynamic joins, the JOIN command is easier to use in that you do not need to edit the Master File each time you want to change the join specification, and you do not need to describe each linked segment as it appears from the perspective of the host data source. On the other hand, Master File defined dynamic joins enable you to omit unnecessary cross-referenced segments.
You may find it efficient to implement frequently used joins as static joins. You can change static joins to dynamic, and dynamic to static, using the REBUILD facility.
The following chart compares implementing a static join defined in a Master File, a dynamic join defined in a Master File, and a dynamic join defined by issuing the JOIN command.
Join Type |
Advantages |
Disadvantages |
---|---|---|
Static Join in Master File (SEGTYPE = KU or KM) |
Faster after first use. Links are created only once. Always in effect. Can select some linked segments and omit others. |
Must be specified before data source is created or reloaded using REBUILD. Requires REBUILD facility to change. Requires four bytes of file space per instance. User needs to know how to specify relationships for linked segments (KL, KLU). |
Dynamic Join in Master File (SEGTYPE =DKU or DKM) |
Can be specified at any time. Always in effect. Does not use any space in the data source. Can be changed or removed as needed, without using the REBUILD facility. Can select some linked segments and omit others. |
Slower. Links are retrieved for each record in each report request. User needs to know how to specify relationships for linked segments (KL, KLU). |
Dynamic Join (using the JOIN Command) |
Can be specified at any time. Does not use any space in the data source. Can be changed or removed as needed, without using the REBUILD facility. User never needs to describe relationships of linked segments. |
Slower. Links are retrieved for each record in each report request. JOIN command must be issued in each session in which you want the join to be in effect. All segments in the target are always included, whether or not you need them. |