My requirement is verify both the files and insert the missing records in the other file (from file1 to file2 and vice versa).
Note : Both the files contain unique records
Ex:
Before running the job -
Code:
File 1 -
---------------------------
key remaining
---------------------------
A XXXXXXXX
B XXXXXXXX
D XXXXXXXX
-------------------------
Code:
File 2 -
---------------------------
key remaining
---------------------------
C XXXXXXXX
E XXXXXXXX
A XXXXXXXX
----------------------------
After running the job (order is not problem i.e., OP file could be in sorted/random order)
Since C& E records are missing from file1, my file should look like
Code:
File 1 -
---------------------------
key remaining
---------------------------
A XXXXXXXX
B XXXXXXXX
D XXXXXXXX
C ALL ZEROES
E ALL ZEROES
------------------------
Since B & D are missing from FILE2, it should look like -
Code:
---------------------------
key remaining
---------------------------
C XXXXXXXX
E XXXXXXXX
A XXXXXXXX
B ALL ZEROES
D ALL ZEROES
----------------------------