Assume that a join logical file is specified as in Basic concepts of joining two physical files (example 1). Note that the join logical file has key fields defined. This case shows which records are returned for a random access read operation using the join logical file.
Assume that PF1 and PF2 have the following records.
Employee number | Name |
---|---|
235 | Anne |
440 | Doug |
500 | Mark |
729 | Sue |
997 | Tim |
Employee number | Salary |
---|---|
235 | 1700.00 |
440 | 950.50 |
729 | 1400.90 |
984 | 878.25 |
997 | 331.00 |
997 | 555.00 |
In PF2, no record is found for record 500, record 984 exists only in PF2, and duplicate records are found for 997.
The program can get the following records.
Given a value of 235 from the program for the Nbr field in the logical file, the system supplies the following record.
Employee number | Name | Salary |
---|---|---|
235 | Anne | 1700.00 |
Given a value of 500 from the program for the Nbr field in the logical file and with the JDFTVAL keyword specified, the system supplies the following record.
Employee number | Name | Salary |
---|---|---|
500 | Mark | 0000.00 |
Given a value of 984 from the program for the Nbr field in the logical file, the system supplies no record and a no record found exception occurs because record 984 is not in the primary file.
Given a value of 997 from the program for the Nbr field in the logical file, the system returns one of the following records.
Employee number | Name | Salary |
---|---|---|
997 | Tim | 331.00 |
or
Employee number | Name | Salary |
---|---|---|
997 | Tim | 555.00 |