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
sunitha_cts
Participant
Posts: 98 Joined: Thu Feb 05, 2009 1:14 am
Location: visakhapatnam
Contact:
Post
by sunitha_cts » Mon Jul 27, 2009 3:52 am
HI,
I want col1 to be in Asc and col 2 to be in Desc in table of 10 reords.how can i implement this ....by using sort stage we could do for the whole table,but how could we do .....
Thanks
sunitha
Sainath.Srinivasan
Participant
Posts: 3337 Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom
Post
by Sainath.Srinivasan » Mon Jul 27, 2009 4:07 am
If you have 10 rows as
1 1
2 2
...
10 10
do you want it as
1 10
2 9
3 8
....
10 1
Is this assumption correct ?
sunitha_cts
Participant
Posts: 98 Joined: Thu Feb 05, 2009 1:14 am
Location: visakhapatnam
Contact:
Post
by sunitha_cts » Mon Jul 27, 2009 4:09 am
Yes you are right
sunitha_cts
Participant
Posts: 98 Joined: Thu Feb 05, 2009 1:14 am
Location: visakhapatnam
Contact:
Post
by sunitha_cts » Mon Jul 27, 2009 4:11 am
Hi,
col1 7 ,6,3
col2 21,4,9
finally
col1 3,6,7
col2 21,9,4
priyadarshikunal
Premium Member
Posts: 1735 Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI
Post
by priyadarshikunal » Mon Jul 27, 2009 4:15 am
split both coloums, sort them individually then a vertical pivot -> funnel ->horizontal pivot.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Sainath.Srinivasan
Participant
Posts: 3337 Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom
Post
by Sainath.Srinivasan » Mon Jul 27, 2009 4:49 am
Wonder whether the final result will make any sense !!??
But one possible solution can be
Source to be split into 2 sorts and add rownum in transformer followed by join by rownum.
What will be the volume? If it is a small source file, you may be better off doing in Unix itself.
nagarjuna
Premium Member
Posts: 533 Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago
Post
by nagarjuna » Mon Jul 27, 2009 4:50 am
cut -d ',' -f 1 | > f1 -----> sort asc
cut -d ',' -f 2 > f2 ----> sort desc
then use paste command .
Nag
sunitha_cts
Participant
Posts: 98 Joined: Thu Feb 05, 2009 1:14 am
Location: visakhapatnam
Contact:
Post
by sunitha_cts » Mon Jul 27, 2009 5:14 am
HI,
It is a scenario asked during an intervew that's the reason i posted it,even i felt it makes nosense but i wanted to know if this is possible that's why i posted it .
Thanks one and all who took patience to answer this