Page 1 of 1

How to join 3 files Lateraly

Posted: Tue Jan 17, 2006 1:55 am
by swarnkar
Hi,

I have to create a job in which i have to extract data from three different tables and create a seq file. These files having six columns each and out which 2 columns are common. Now depending on the these 2 key columns i have to create a files having column of all three files.

Like

File1

01,A,19.0.10.11
02,B,10,20.0.05

File2
01,A,CC,BB,08,07
02,B,NN,AC,09,01

file3
01,A,11,00,55,of
02,B,33,44,00,OK

Now in Output File I want
01,A,19.0.10.11,,CC,BB,08,07,,11,00,55,of
02,B,10,20.0.05,,NN,AC,09,01,,33,44,00,OK


Please help

Thanks

Posted: Tue Jan 17, 2006 2:22 am
by kumar_s
Hi,
Various stages available for this requirement. You can use Lookup, Merge or Join based on your requirement.
Go through the document available in you client machine. Else search for keyoword Join or merge or lookup in this forum, you may get the details.

-Kumar

Posted: Tue Jan 17, 2006 2:22 am
by kcshankar
Hi swarnkar,

Make File1 as source and do lookup on File2 and File3 for key column1 and 2 and get the remaining fields.
Or use Merge stage to do the same.

Regards
kcs

Posted: Tue Jan 17, 2006 2:33 am
by swarnkar
kcshankar wrote:Hi swarnkar,

Make File1 as source and do lookup on File2 and File3 for key column1 and 2 and get the remaining fields.
Or use Merge stage to do the same.

Regards
kcs
But with this approach i will miss the records which are in file2 and file3 but not in file1

Posted: Tue Jan 17, 2006 2:50 am
by ray.wurlod
If they're tables, as you say, why not simply join them using SQL? If they're not, load two into hashed files, and do standard lookups in a Transformer stage.

Posted: Tue Jan 17, 2006 2:51 am
by balajisr
Hi Kumar
Various stages available for this requirement. You can use Lookup, Merge or Join based on your requirement.
I think swarnkar is working in server jobs and not parallel.

--Balaji S.R

Posted: Tue Jan 17, 2006 3:00 am
by kumar_s
So the join stage need to be cut off. :wink:

-Kumar