A dynamic keyed sequence access path over a join logical file allows you to specify a processing sequence in which the keys can be in different physical files (DDS restricts the keys to the primary file).
The specification is identical to the previous method. The access path is specified using whatever key fields are required. There is no restriction on which physical file the key fields are in. However, if a key field exists in other than the primary file of a join specification, the system must make a temporary copy of the joined records. The system must also build a keyed sequence access path over the copied records before the query file is opened. The key fields must exist in the format identified on the FORMAT parameter.
This example shows how to use a field in a secondary file as a key field.
Assume that you already have a join logical file named JOINLF. FILEX is specified as the primary file and is joined to FILEY. You want to process the records in JOINLF by the Descrp field which is in FILEY.
Assume that the file record formats contain the following fields:
|
OVRDBF FILE(JOINLF) SHARE(*YES) OPNQRYF FILE(JOINLF) KEYFLD(DESCRP) CALL PGM(PGMC) CLOF OPNID(JOINLF) DLTOVR FILE(JOINLF)
OPNQRYF FILE(JOINLF) KEYFLD(DESCRP QTY)