Joined: 06 Sep 2006 Posts: 44 Location: United States
Guys, Appreciate your help me on following requirement:
I've 2 input files(not in sorted order) , compare both files with matching key as(1st 4 digits) and create 4 output files: Output File1 with matching records only from input file1 and output File 2 with matching records only from input file2(Although key matches , I need to validate the remaining records latter from the files separately)
Output file 3 with unmatched records from input file1 and Output file 4 with unmatched records from input file2.
Sample Records
Input File1:
2222Keith
1111David
4444Sam
3333Rohit
Joined: 06 Sep 2006 Posts: 44 Location: United States
Thanks sergeyken for quick response...
Assume my record length is set to 80 , with first 4 digits as key
may I know what is the value I can add in 'Include =' . I don't have any specific condition to filter out the records.
Also please help me on REFORMAT FIELDS=...,FILL=...
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
scdinesh,
Since you need to write the entire record area from both the inputs, your REFORMAT should include both F1 and F2 fields. Something like,
Code:
REFORMAT FIELDS=(F1:1,80,F2:1,80,?)
Your OFILE1 (matched records from input1) and OFILE2 (matched records from input2) should both INCLUDE 'B' records, but write only F1 and F2 records respectively into each of those outputs.
Similarly for OFILE3 (unmatched from input1) and OFILE4 (unmatched from input2) write relevant fields to output in the BUILD.
Joined: 06 Sep 2006 Posts: 44 Location: United States
Thanks Arun for the help!!!
"Your OFILE1 (matched records from input1) and OFILE2 (matched records from input2) should both INCLUDE 'B' records, but write only F1 and F2 records respectively into each of those outputs"
In my case I want to write only F1 records into OFILE1 upon condition , how does it know it should write only F1 records? (as we have mentioned both F1 and F2 in 'Reformat fields'). Please help
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
In my case I want to write only F1 records into OFILE1 upon condition , how does it know it should write only F1 records?
The BUILD parameter in each OUTFIL group lets you choose specific fields from the REFORMAT-ted combined record (161 bytes in your case).
It is just a matter of writing first 80 bytes of the reformatted record into your first OUTFIL and the next 80 bytes of the reformatted record into your second OUTFIL.
I would suggest that you first just write the reformatted output to one dataset, so that you can see how the join operation is outputting the joined data in relation to the match marker value(s). That might help you to understand how to write your INCLUDE conditions and BUILD parameters for the OUTFIL files.