Implement the below logic

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
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Implement the below logic

Post by vskr72 »

I have 3 cols like this:

Code: Select all

Col1,    Col2,   Col3
-----------------------
ABC,           ,
      ,     DEF, 
      ,          ,   XYZ 

I need to convert this into a single row:

Code: Select all

Col1,    Col2,   Col3
-----------------------
ABC,    DEF,   XYZ
I tried using an AGG, but it did an implicit conversion into some numbers. Is it possible to do it in any other way. Pls suggest.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You should still be able to use an Aggregator for this by telling it to 'retain data type'... or something very close to that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

In transformer using Stage variables,you can accomplish this.
Consider you are having 3 columns always,then check for Field(input,",",1),if it's not null then store it in a stage Variable.
Next record check Field(input,",",2) and Append it to the previous stage Variable.
FInally take the last record from the transformer.

Please let me know if you need any more information
pandeeswaran
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Post by vskr72 »

Thank you Craig. That solution worked well.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

So, Can you please resolve?

Thanks
pandeeswaran
Post Reply