Stage to be used

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
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Stage to be used

Post by scorpion »

Hi All,

I am looking for some solution,

I have 2 input data flows in my job from same table.

But in my out put i need one column is from 1st transformer and the other column is from 2nd transformer.

for ex:

EMP1---------------> Transformer1
(EMPNUMBER,
EMPNAME)

EMP2--------------->Transformer2
(EMPNUMBER,
EMPNAME)

Now in my Transformer3(output) I need EMPNUMBER from Transformer1 and EMPNAME from Transformer2.


so one column from 1st transformer and other column is from 2nd transformer.

How can I approach this?

Copy and Transformer stages will not allow more than 1input link.

which stage i can use to perform this.
Thanx&Regards
scorpion
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I have trouble understanding this - normally you would join (for instance in a lookup stage) on the common EMPNAME or EMPNUMBER. But you might use a funnel stage to combine the 2 streams and then combine the 2 rows in a subsequent transform stage.
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Post by scorpion »

Hi Arndw,

Thanks for the reply,If go for funnel,is it possible to select one column from 1st transformer and other column is from 2nd transformer.

If so,In out put mapping window in funnel,how should i map one column from 1st trans and the other column from 2nd trans.

Please reply
Thanx&Regards
scorpion
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The funnel won't do that for you. But in a subsequent transform stage you can store the value from the previous row using stage variables and combine the rows there. If you explain why you need to do this (perhaps with an example) we might be able to suggest a better solution or approach.
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Post by scorpion »

Thanks ArndW,

I am extracting records from 2sybase tables(ex: A,B) based on some extraction logic in user-defined query in sybase stage.

I am extracting columns from both the tables.And I am populating in to a TARGET file,after implementing some transformation logic.

Now for one of the target column i need to change the logic to poulate that.

For that perticular target column i am mapping one of the column from table A.

So I need to change the logic to populate target column like below:

SELECT

v2.column1

FROM A v1,A v2 where v2.COLUMN2 = v1.COLUMN3

(Here 'A' is the table name and v1,v2 are aliases)

This coloumn1 ,i have to map the target field.

What could be the best approach?
Thanx&Regards
scorpion
gbusson
Participant
Posts: 98
Joined: Fri Oct 07, 2005 2:50 am
Location: France
Contact:

Post by gbusson »

hi,

the "easiest" ways :

a user defined SQL in the sybase stage.


By the way, how many rows do you have in output in each flow?
gbusson
Participant
Posts: 98
Joined: Fri Oct 07, 2005 2:50 am
Location: France
Contact:

Post by gbusson »

hi,

the "easiest" ways :

a user defined SQL in the sybase stage.


By the way, how many rows do you have in output in each flow?
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Post by scorpion »

Hi Thanks for the reply,

I have the input flow already in one transformer,so i am planning to implement this(user-defined qry)in a seperate flow.

i need to combine thease 2 input transformer (both has the same colflows.

and i will map the target column from 2nd transformer flow.(which will have the user defined qrys results).

so now how to combine thease 2 flows and how to map 1column from 2nd transformer and rest are from 1st trasformer.

as i posted it previously:

EMP1---------------> Transformer1
(EMPNUMBER,
EMPNAME)

EMP2--------------->Transformer2
(EMPNUMBER,
EMPNAME)

Now in my Transformer3(output) I need EMPNUMBER from Transformer1 and EMPNAME from Transformer2.


so one column from 1st transformer and other column is from 2nd transformer.


how do u suggest?
Thanx&Regards
scorpion
Post Reply