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
sreesuku2
Participant
Posts: 45 Joined: Tue Oct 22, 2013 11:45 am
Post
by sreesuku2 » Thu Apr 10, 2014 12:03 am
Hi,
I think its a simple one..
I have 2 files as listed below.
File1
File2
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
Posts: 536 Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore
Post
by prasson_ibm » Thu Apr 10, 2014 1:18 am
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
Post
by ssnegi » Thu Apr 10, 2014 1:52 am
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 » Thu Apr 10, 2014 3:17 am
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
Post
by ssnegi » Thu Apr 10, 2014 3:27 am
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Apr 10, 2014 7:00 am
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 » Thu Apr 10, 2014 5:10 pm
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.