Datastage Join

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
sreesuku2
Participant
Posts: 45
Joined: Tue Oct 22, 2013 11:45 am

Datastage Join

Post by sreesuku2 »

Hi,

I think its a simple one..

I have 2 files as listed below.

File1

Code: Select all

Project	Practice
ABC	     AD
ABC	     Cloud
File2

Code: Select all

Project	ID
ABC	    ID1
ABC	    ID2
I need to create a file3 as below

Code: Select all

Practise	ID
AD	      ID1
AD	      ID2
Cloud      ID1
Cloud      ID2
Can somebody help
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,

It is cross join.

Job design will look like below:-

Code: Select all

                     c-----Lnk1---->LKP1------>f
       File2-----> Copy(c)      File1----->Filter            Funnel(f)----->Dataset   
                             c----Lnk2----->LKP2------->f 
Use file2 as a source.In Copy stage pass both columns to link1 and link2.

File1 will be input to filter stage which has two output links. Filter the records based on "AD" and "Cloud" and pass to respective links which will be reference to the lookup stage.

Funnel the outputs from lookup stage.
ssnegi
Participant
Posts: 138
Joined: Thu Nov 15, 2007 4:17 am
Location: Sydney, Australia

Reply

Post by ssnegi »

you can create a dummy column in both files hard coded to 1 in transformer. Then join the dummy column from both links.

file1 --> transformer Dummy 1-->
-----------------------------------------Join Inner Dummy--> output
file2 --> transformer Dummy 1-->
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Investigate the possibilities in a Merge stage.

Ignore ssnegi's response, which is not applicable for server job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ssnegi
Participant
Posts: 138
Joined: Thu Nov 15, 2007 4:17 am
Location: Sydney, Australia

Reply

Post by ssnegi »

There is transformer in server job and you can output that to sequential files and then do inner join using merge stage
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I think Ray meant Prasson, his is the PX specific one. And it just looks like a cross join from the very small sample data posted but I doubt it is - so the Merge stage should be able to handle the two files directly without any shenanigans.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

ssnegi specifies a Join. There is no Join stage in server jobs.

prasson's is also a parallel solution.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply