Row Splitter Help !

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

Post Reply
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Row Splitter Help !

Post by vinaymanchinila »

Hi,
I have to split more than 1 row from the source data comming from single Oracle stage, I ahve used Row Splitter and it works great for one row, how do I go about for more than 1 row!
Thanks a lot
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Convert them into a single row.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi Sai,
The source is like
'Date1,Center1,City1'
'Date2,Center2,City2'
...
'DateN,CenterN,CityN'

I am splitting the row based on the delimiter "," and how do I concatenate all the rows into one column ! It is a SQL Query that returns the rows like this and I have no fixed number of records.

Thanks,
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi,
I got this to work by using RowSplitter followed by a Pivot Stage!
tzor
Participant
Posts: 2
Joined: Thu Mar 04, 2004 11:50 am
Location: Hauppauge, LI, NY, USA

Post by tzor »

One of our consultants had a interesting trick to combine the rows, basically use a transformer with a stage variable to create an ever growing concatenated string followed by an aggregator stage with a LAST function to get the final concatenated value as a single row.
changming
Participant
Posts: 68
Joined: Wed Oct 13, 2004 3:35 am

Post by changming »

vinaymanchinila wrote:Hi Sai,
The source is like
'Date1,Center1,City1'
'Date2,Center2,City2'
...
'DateN,CenterN,CityN'

I am splitting the row based on the delimiter "," and how do I concatenate all the rows into one column ! It is a SQL Query that returns the rows like this and I have no fixed number of records.

Thanks,
Just to answer the question how to concatenate all the rows into on clolumn:
read the flate file using delimeter other than ",", such as TAB.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Can you explain what you expect to do with the rows. The rows appear to represent on set each. So why do you say your information spans across rows?
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi,
I get the Date column only from which I derive Date2 , Date3...DateN
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What about Center and City columns?
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Those columns go with all the other columns, I mean I extract it once but use it every data set.

Thanks
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

In that case, I think you need stage variables and not row splitter.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

I guess, but it is working fine with the row splitter and also the performance is good so leaving it there for now.

Thanks for looking into it Sai
Post Reply