I have 2 input (input1 and input2) files and I need 3 output(output1,output2,output3) files.
1) The output1 will have the matched records,
2) The Output2 will have the unmatched records which is present in the input2 but not in input1.
3) The Output3 will have the unmatched records which is present in input1 but not in input2.
I have a similar requirement, but in my case both file records have exactly the same fields and lrecl.
I don't have blank fields in the input files records so that I can distinguish which record belongs to input file 1 or 2.
Joined: 18 Jul 2007 Posts: 2150 Location: At my coffee table
Exploiting SyncSort JOIN wrote:
REFORMAT defines the record layout to be produced by the join processing. If a record has been added to the master file, it will appear only in file 1 (the second half of the reformatted record is X’FF’, and the first half contains data). If the record is modified, it will appear in both file 1 and file 2 (both halves of the record contain data). If the record was deleted, it will appear only in file 2 (the first half of the reformatted record will contain X’FF’, while the second half contains data).
In this example, the record might or might not exist on the master file or the backup depending upon if the record is a new addition or a recent deletion.