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
Nagaraj
Premium Member
Posts: 383 Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore
Post
by Nagaraj » Wed Sep 23, 2009 9:00 am
Hi Folks,
In one column i have data like this,
hsd sdj hds ddh sdh hsd
hsd djd
ggh hsd jsd
i have to derive columns based on the delimeter, but the no of columns are dynamic, lets say we can find out the number of columns coming thru in each record. So is there any way of assigning each value to the subsequent columns defined in the transformer.
Thanks
Nagaraj
Premium Member
Posts: 383 Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore
Post
by Nagaraj » Wed Sep 23, 2009 9:38 am
No
we are not sure how many columns we get...!
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Wed Sep 23, 2009 9:54 am
But do you know the maximum number you could get?
-craig
"You can never have too many knives" -- Logan Nine Fingers
Nagaraj
Premium Member
Posts: 383 Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore
Post
by Nagaraj » Wed Sep 23, 2009 9:59 am
I assumed it cannot go more than 20 values like that and coded accordingly, its working but i wanted to code dynamically.
Sainath.Srinivasan
Participant
Posts: 3337 Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom
Post
by Sainath.Srinivasan » Wed Sep 23, 2009 10:24 am
In that case, how do you intend to store in the target ?
Generally the target is a db and cannot have dynmically changing structure.
Maybe more information on your requirement will assist others in helping you.
srividya
Participant
Posts: 62 Joined: Thu Aug 25, 2005 2:31 am
Location: Ashburn,VA
Post
by srividya » Wed Sep 23, 2009 12:23 pm
May be the data is record type driven, say the first 3 places are 001 then it is for one kind of data , if it is for 008 it is another set of data
Nagaraj
Premium Member
Posts: 383 Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore
Post
by Nagaraj » Wed Sep 23, 2009 12:45 pm
Yes Kind of Srividya,
I am defining n no of columns in transformer and after that i am funneling all the values so that it goes to one column, but in between i should apply different rules i wll have to treat my source column with many values as some array.
srividya
Participant
Posts: 62 Joined: Thu Aug 25, 2005 2:31 am
Location: Ashburn,VA
Post
by srividya » Wed Sep 23, 2009 1:06 pm
will you be able to give a more specific screen shot of data than what you have already given? That would help us understand how the feed would look like
Nagaraj
Premium Member
Posts: 383 Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore
Post
by Nagaraj » Wed Sep 23, 2009 4:21 pm
i have two columns
A B
1 gfg gfg kzl dsk gdg
2 hdh hdh
3 dhd dhd hdh jdk jdj jdj kjd
column B values will be further derived and added in the end, doing group by column A.
Thanks
eostic
Premium Member
Posts: 3838 Joined: Mon Oct 17, 2005 9:34 am
Post
by eostic » Thu Sep 24, 2009 6:07 am
Looks like you are trying to do a classic pivot? do you want multiple rows --- one for each of the "B's" (each 3 character value to have its own row)?
Ernie
Nagaraj
Premium Member
Posts: 383 Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore
Post
by Nagaraj » Thu Sep 24, 2009 7:14 am
Please see the questiona again, i dont have problems with pivoting,
i want to calculcate how many values are there in an array and accordingly i have to put each of them in seperate columns(which has its own derivation), in the end i am funnelling.
kumar_s
Charter Member
Posts: 5245 Joined: Thu Jun 16, 2005 11:00 pm
Post
by kumar_s » Thu Sep 24, 2009 7:16 am
How will you identify the individual column name for the column B.
Could you write up the expected output?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Nagaraj
Premium Member
Posts: 383 Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore
Post
by Nagaraj » Thu Sep 24, 2009 9:50 am
it has a delimeter, please see the first question asked initially.