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.
Output1 - File Length - 93 (Format same as input2)
Output2 - File Length - 93 (Format same as input2)
Output3 - File Length - 1717 (Format same as input1)
I'm able to get the 2 output files (Output1 and Output2) with the below sort:
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: 2146 Location: At my coffee table
Exploiting SyncSort JOIN wrote:
Code:
REFORMAT FIELDS=(F1:1,40,
F2:1,40),FILL=X'FF'
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.