Descendant Segment Retrieval of Network Records

In this section:

To retrieve records from a descendant segment, the navigational strategy of the adapter depends on Access File parameters and the SEGTYPE parameter in the Master File. In a few cases, the selection criteria in a request also affect the strategy.

In general, the ACCESS parameter in the Access File determines retrieval strategy because it indicates how parent/descendant relationships are implemented. There is a retrieval strategy for each kind of relationship:


Top of page

x
Set-Based Retrieval

For a set relationship (ACCESS=SET), the IDMS set is walked or searched starting with the owner to obtain related member records. Set relationships are physical ones, implemented by set pointer chains. The SEGTYPE attribute in the Master File indicates whether the descendant segment is unique or non-unique.

If the descendant segment is non-unique (SEGTYPE=S), it represents a member record-type. For non-unique descendants, the adapter issues the following command:

OBTAIN NEXT record WITHIN setname 

This command is repeated until IDMS indicates that the end of the set is reached. Then the adapter obtains records of other descendant segments for the same parent segment or, if no other descendants exist, the next parent record is retrieved.

If the descendant segment is unique (SEGTYPE=U), it represents an owner record-type. For unique descendants, the adapter issues this command:

OBTAIN OWNER WITHIN setname 

This command is issued once, since there is one owner per set. The adapter continues to retrieve descendant records for the same parent or retrieves the next parent record.

The KEYFLD and MULTMBR attributes in the Access File also affect retrieval for certain requests. For a sorted set, the KEYFLD parameter specifies that the set is ordered by a specified field. When the request references a field from the parent segment and has an IF test (EQ, FROM...TO, GT, GE, LT, LE) on the sort field, the adapter sends this command to IDMS:

OBTAIN record WITHIN setname USING value 

If there are duplicate records (SETDUP=Y), the adapter issues this command:

OBTAIN NEXT record WITHIN setname 

When the value of the sort field changes beyond the specified range, retrieval for that segment stops. I/O operations are minimized when the sort field value is supplied in the OBTAIN command.

Note: The means of implementing the sorted set, the traditional method or using IDMS Integrated Indices, is transparent to the adapter.

The MULTMBR attribute indicates an IDMS multi-member set. When it is specified, the adapter searches for other member record-types (segments) in the Access File with the same set name. As a result, all necessary IDMS areas are activated.


Top of page

x
CALC-Based Retrieval

CALC-based relationships (ACCESS=CLC) are performed with embedded cross-references. A field in the parent segment corresponds to the CALC field in its descendant. The adapter uses the value from the parent field and performs entry-level IDMS retrieval. The process of retrieving records from a descendant segment is similar to that of an entry segment. The difference is that the value supplied by the parent segment acts as the selection criteria, as if the request contained explicit IF criteria.

After the adapter retrieves the host field value (KEYFLD=value) from the parent segment, it calls IDMS:

OBTAIN CALC record 

Then, if the descendant segment is non-unique (SEGTYPE=S), the adapter issues the following command until all of the appropriate records are obtained to satisfy the request:

OBTAIN DUPLICATE record 

Note: IF the CLCDUP parameter does not correspond to the SEGTYPE parameter, the following error message is generated

(FOC919)  WARNING: SAMPLE SIZE IS INSUFFICIENT FOR THIS ANALYSIS

A descendant segment with a CALC-based relationship (ACCESS=CLC) may act as a parent and be related to its descendants using set-, CALC-, or index-based relationships.


Top of page

x
Index-Based Retrieval

Like CALC-based relationships, index-based relationships (ACCESS=IX) also use embedded cross-references. In index-based relationships, the field in the descendant segment represents an index on the IDMS record-type. The index can be an Integrated Index. The adapter uses the value from the parent segment and performs entry-level IDMS retrieval by walking the index set. The process of retrieving records from a descendant segment is similar to that of an entry segment. The difference is that the value supplied by the parent segment acts as the selection criteria, as if the request contained explicit IF criteria.

After the adapter retrieves the host field value (KEYFLD=value) from the parent segment, it calls IDMS:

OBTAIN FIRST record WITHIN setname USING value 

Then, if the descendant segment is non-unique (SEGTYPE=S), the adapter issues the following command until all indexed records with the host value are retrieved:

OBTAIN NEXT record WITHIN setname 

Note: IF the IXDUP parameter does not correspond to the SEGTYPE parameter, the adapter generates the following error message:

(FOC919)  WARNING: SAMPLE SIZE IS INSUFFICIENT FOR THIS ANALYSIS

Only a descendant segment with an Integrated Index may act as a parent and be related to its descendants using set-, CALC-, or index-based relationships.


Information Builders