Setting up a join logical file
These examples show how to create a variety of join logical files.
In general, the examples in these topics include a picture of the files, data description specifications (DDS) for the files, and sample data. For example 1, several cases are given that show how to join files in different situations (when data in the physical files varies).
In these examples, for convenience and ease of recognition, join logical files are shown with the label JLF, and physical files are illustrated with the labels PF1, PF2, PF3, and so forth.
- Example 1: Basic concepts of joining two physical files
A join logical file is a logical file that combines (in one record format) fields from two or more physical files because not all the fields in the record format need to exist in all the physical files. This example shows a join logical file that joins two physical files.
- Setting up a join logical file
To create a join logical file, follow this process.
- Example 2: Using more than one field to join files
You can specify more than one join field to join a pair of files. This example shows the fields in the logical file and the two physical files.
- Example 3: Reading duplicate records in the secondary file
This example shows how a join logical file reads duplicate records in the secondary file based on the specification of the Join Duplicate Sequence (JDUPSEQ) DDS keyword.
- Example 4: Using join fields whose attributes are different
This example shows how to handle join fields when their attributes (length, data type, and decimal positions) are different.
- Example 5: Describing fields that never appear in the record format
Neither fields (where N is specified in position 38) can be used in a join logical file for neither input nor output. Neither fields are not included in the record format. This example shows how to describe such fields that never appear in the record format.
- Example 6: Specifying key fields in a join logical file
This example illustrates the rules for specifying key fields in a join logical file.
- Specifying select/omit statements in a join logical file
When you specify select/omit statements in a join logical file, follow these rules.
- Example 7: Joining three or more physical files
This example shows how to use a join logical file to join three or more physical files.
- Example 8: Joining a physical file to itself
This example shows how to use a join logical file to combine records from one physical file.
- Example 9: Using defaults for missing records from secondary files
This example shows how to use the default value for a missing join field in a secondary file to join to the other secondary file.
- Example 10: A complex join logical file
This example shows a more complex join logical file.
- Join logical file considerations
Consider performance, data integrity, and rules for join logical files.
Parent topic:
Setting up logical files
Related concepts
Joining data from more than one table