|
Answer» There are 2 possible APPROACHES for this: - APPROACH 1:
- We can read records from both files, if the key fields match, then they can be ignored.
- If upon key comparison, the results are unequal, then we identify which FILE has missing or new records and update the file with missing records accordingly.
- Approach 2:
- If both files have the same records, then the work will be reduced.
- If file 1 comes to the AT END state, then we have to move HIGH VALUES into the key field. The same goes to file 2.
- This process needs to be repeated until both key fields are equal to HIGH VALUES.
- For this process to work, the key fields should be in PIC(X) format and not numeric.
To make the process easier, we can avoid a lot of I-O operations by reading data to the local array table and then processing the records from there.
|