Combining 6 outputs into 1

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
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Combining 6 outputs into 1

Post by pavan_test »

Hi All,

I have 6 separate Join stages in my job and I am performing a left outer Join on a key column in each of the 6 joins. The key column is different in each of the 6 joins.

There is a output link coming from each Join. There are no Rejects.
Here are the output link names;
link_1
link_2
link_3
link_4
link_5
link_6

Each output coming from Join has 51 columns, out of which first 45 columns are common in all the 6 outputs links.

I have to combine all 6 links into one and write it to the output. My output must contain 51 columns. And this is how I have to form a record in my output.


Since first 45 columns are common in all the 6 links I can select them from any link and move them to the output.

Then I have to select 46th column ONLY from link_1, 47th column from link_2, 48th column from link_3, 49th column from link_4, 50th column from link_5 and 51st column from link_6.


Is there any stage in data stage which can take 6 inputs links and form a output record as above.

Can anyone please suggest me for my problem.

Regards
Pa
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Put a Column Generator stage on each left input link to generate the six columns. Map the relevant column only from the right input to the output. Run all these through a Funnel stage then through a Transformer or Aggregator stage to select the appropriate value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Combining 6 outputs into 1

Post by pavan_test »

Hi,

I have a reference file, source file, copy then 6 outputs from copy and then 6 join stages. each join stage performing join on a key column from source file with refrence file.

can you suggest me where do i add the column generator..you mean after Join stage..

Regards
PA
anil411
Premium Member
Premium Member
Posts: 53
Joined: Thu Aug 11, 2005 8:34 am

Re: Combining 6 outputs into 1

Post by anil411 »

Hi ,

At present we assume you get the following Output after join.

Link1
Sl_no Value
1 Industry

Link2
Dep_No Value
2 HR

Link3
Emp_no Value
3 Anil

Link4
I nvoice_Number Value
4 Refrigator

Link5
Tel_key Value
5 571-777-8888

Link6
Mrtg_No Value
6 800000

2. Please follow the below process

Before join if you have Sl_No, Value has column names for Link1 , then generate following columns Dep_No, Emp_no, Invoice_Number, Tel_key, Mrtg_No using column generator.

Do the same for remaining.

After join the Output Links should have all the columns

Link1
Sl_No Dep_No Emp_no Invoice_Number Tel_key Mrtg_No Value
1 Industry

Link 2
Sl_No Dep_No Emp_no Invoice_Number Tel_key Mrtg_No Value
2 HR

Link 3
Sl_No Dep_No Emp_no Invoice_Number Tel_key Mrtg_No Value
3 Jayaram

Link 4
Sl_No Dep_No Emp_no Invoice_Number Tel_key Mrtg_No Value
4 Refrigator

Link5
Sl_No Dep_No Emp_no Invoice_Number Tel_key Mrtg_No Value
5 571-777-8888

Link6
Sl_No Dep_No Emp_no Invoice_Number Tel_key Mrtg_No Value
6 8000000


Use the Funnel stage to merge all the rows.

Hope this will help.

Anil.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

On the left input link of each Join stage.

The idea is to get the outputs of all the Join stages to use the same schema, so that they can be processed by a single downstream stage to effect the combination you desire.
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