Join Stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Join Stage

Post by pp »

I have 2 inputs say file1 and file2 to a join stage.

Both the inputs have 6 fields. Now the output should contain 3 fields from the file 1 and 3 fields from the file 2.

Fields in File 1 and 2

name
address
city
state
phone
email

Now in my output I would like to see name, address,city from file 1 and state, phone, email from file 2. Is there a way we can achieve this ?

Thank you.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Re: Join Stage

Post by swades »

pp wrote: Now in my output I would like to see name, address,city from file 1 and state, phone, email from file 2. Is there a way we can achieve this ?

Thank you.
so you have any key for join or not?
pp
Participant
Posts: 27
Joined: Tue Apr 03, 2007 8:50 pm

Post by pp »

yes I have one field as key.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then simply specify that field as the join key, and make sure that you partition and sort on that field.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Hi Ray,

How join supports 2 outputs here?

is it required to use any other stage with join?

Regards
RD
dhanashreepanse
Participant
Posts: 25
Joined: Fri Jan 11, 2008 12:49 am
Location: Pune, India

Post by dhanashreepanse »

Rajesh,

Based on the joining key, Join stage can take the required columns from both the input files.
On the output -->mapping tab, you can specify the required mappings.

-Dhanashree
sureshabbisetti
Participant
Posts: 21
Joined: Thu Oct 04, 2007 4:34 am
Location: India
Contact:

Post by sureshabbisetti »

Hi
Use Copy stage after join stage. In each output link select only the required columns.
Thanks & Regards
Suresh Kumar Abbisetti
krisna
Participant
Posts: 77
Joined: Tue Apr 08, 2008 11:33 pm

Post by krisna »

As suresh said, using of Copy stage after join stage is working fine
Prabhakar
Participant
Posts: 10
Joined: Mon Apr 02, 2007 6:28 pm
Location: Melbourne

Post by Prabhakar »

The simplest wayt to do is send one of the data thru a cpy stage and rename the field for eg. if you are sending the File1 data then File1_<ColumnName> this apply to all the column except the key column and do a join with other file and the key column should be partioned and sorted and select only the column, you required in the mapping tab. This will work only if join is a inner join.
Post Reply