The dynamic join function allows you to join files without having to first specify data description specifications (DDS) and create a join logical file.
You must use the FORMAT parameter on the Open Query File (OPNQRYF) command to specify the record format for the join. You can join any physical or logical file including a join logical file and a view (DDS does not allow you to join logical files). You can specify either a keyed or arrival sequence access path. If keys are specified, they can be from any of the files included in the join (DDS restricts keys to just the primary file).
In the following examples, it is assumed that the file specified on the FORMAT parameter was created. You normally want to create the file before you create the processing program so you can use the externally described data definitions.
The default for the join order (JORDER) parameter is used in all of the following examples. The default for the JORDER parameter is *ANY, which tells the system that it can determine the order in which to join the files. That is, the system determines which file to use as the primary file and which as the secondary files. This allows the system to try to improve the performance of the join function.
The join criterion, like the record selection criterion, is affected by the sort sequence (SRTSEQ) and the language identifier (LANGID) specified.