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
sri75
Premium Member
Posts: 132 Joined: Thu Sep 09, 2004 12:42 pm
Post
by sri75 » Wed Apr 27, 2011 5:24 pm
Hi,
Can you please advice me how to achieve below logic
my source data is like this
Code: Select all
key1 key2 col1 col2 col3 col4 col5 col6 col7 col8 col9
1111 2222 ** abc 10.25
1111 2222 $$ def 11.9
1111 2222 ## ghi 10.4
output should be like this
Code: Select all
key1 key2 col1 col2 col3 col4 col5 col6 col7 col8 col9
1111 2222 ** abc 10.25 $$ def 11.9 ## ghi 10.4
can we do this usiing aggregate stage instead of stage variables.
Thanks
Sri
sri75
Premium Member
Posts: 132 Joined: Thu Sep 09, 2004 12:42 pm
Post
by sri75 » Wed Apr 27, 2011 5:27 pm
sorry, my data is not looking correct
** abc 10.25 - this is first record for col1, col2 and all cother columns have spaces
$$ def 11.9 - this is second record for col 4, col5 and col6 and all other columns have spaces
## ghi 10.4 - this is third record for col7,col8 and col9
Thanks
Sri
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Wed Apr 27, 2011 5:58 pm
Corrected.
-craig
"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Wed Apr 27, 2011 5:59 pm
sri75 wrote: can we do this usiing aggregate stage instead of stage variables.
Yes, take the max of each column.
-craig
"You can never have too many knives" -- Logan Nine Fingers
sri75
Premium Member
Posts: 132 Joined: Thu Sep 09, 2004 12:42 pm
Post
by sri75 » Wed Apr 27, 2011 7:40 pm
Thanks chulett. I tried with max, but it is giving all zeros. do I need to take other things into consideration
thanks
sri75
Premium Member
Posts: 132 Joined: Thu Sep 09, 2004 12:42 pm
Post
by sri75 » Wed Apr 27, 2011 8:11 pm
all fileds are defined as char. I need to conver from char and integer and get the max
Thanks
priyadarshikunal
Premium Member
Posts: 1735 Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI
Post
by priyadarshikunal » Tue May 03, 2011 6:10 am
Since you are on 8x, you can try to use "Preserve type" to prevent the conversion from char to dfloat/decimal.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue May 03, 2011 6:34 am
Did you get this working? I'm curious why you thought you needed to convert anything, this should have worked fine with strings...
-craig
"You can never have too many knives" -- Logan Nine Fingers
greggknight
Premium Member
Posts: 120 Joined: Thu Oct 28, 2004 4:24 pm
Post
by greggknight » Tue May 03, 2011 7:45 am
If you're on 8.5 use the looping functionality.
or use the combine records stage under the restructure tab in the palette
"Don't let the bull between you and the fence"
Thanks
Gregg J Knight
"Never Never Never Quit"
Winston Churchill