Case 2A: A record missing in the secondary file (JDFTVAL keyword not specified)

 

This example join logical file misses one record in the primary file because it does not have a match in the secondary file and the Join Default Values (JDFTVAL) DDS keyword is not specified.

Assume that a join logical file is specified as in Example 1: Basic concepts of joining two physical files, and there are four records in PF1 and three records in PF2, as shown in the following two tables.

Table 1. Physical file 1 (PF1)
Employee number Name
235 Anne
440 Doug
500 Mark
729 Sue

Table 2. Physical file 2 (PF2)
Employee number Salary
235 1700.00
440 950.50
729 1400.90

In PF2, no record is found for number 500.

The program reads the join logical file and gets the following records.

Table 3. Join logical file (JLF)
Employee number Name Salary
235 Anne 1700.00
440 Doug 950.50
729 Sue 1400.90

If you do not specify the JDFTVAL keyword and no match is found for the join field in the secondary file, the record is not included in the join logical file.

 

Parent topic:

Example 1: Basic concepts of joining two physical files