How to join 3 files Lateraly

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
swarnkar
Participant
Posts: 74
Joined: Wed Jan 11, 2006 2:22 am

How to join 3 files Lateraly

Post 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
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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
kcshankar
Charter Member
Charter Member
Posts: 91
Joined: Mon Jan 10, 2005 2:06 am

Post 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
swarnkar
Participant
Posts: 74
Joined: Wed Jan 11, 2006 2:22 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post 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
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

So the join stage need to be cut off. :wink:

-Kumar
Post Reply