I have created a simple datastage job which performs the following.
1. Prepare data using row generator stage(10 integer records starting from 1 to 10) with only one column COL1
2. Perform a sequential sort using a sort stage(descending sort)
3. Write the records into a text file.
I have used sort utility as both datastage and UNIX and observed the following.
Output(Datastage sort):
10
9
8
7
6
5
4
3
2
1
Which is working perfectly.
Output(UNIX sort):
9
8
7
6
5
4
3
2
10
1
Is not giving the proper output.
In UNIX it always sort the records as String by default.The command for numeric sort is
sort -n <filename>
How can we achive this in datastage if we choose sort utility as UNIX in sort stage?
Also is there any such guidline to use datastage sort and UNIX sort?
Sort utility in sort stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 152
- Joined: Mon Mar 07, 2011 6:16 am
Sort utility in sort stage
Soumya
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What is the data type of the column you're sorting?
Incidentally, DataStage sort in 8.1.1 and later will always out-perform Unix sort. The option has really only been left in the stage for backwards compatibility.
Incidentally, DataStage sort in 8.1.1 and later will always out-perform Unix sort. The option has really only been left in the stage for backwards compatibility.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Sort utility in sort stage
That's simple - don't use the UNIX sort.soumya5891 wrote:Also is there any such guidline to use datastage sort and UNIX sort?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 152
- Joined: Mon Mar 07, 2011 6:16 am
Re: Sort utility in sort stage
Thanks all for your reply.
@Ray : Datatype I have used as Integer
@Chulett : Everywhere I have used Datastage sort . I was reading about psort and tsort, then I have tried this by developing sample job and saw the difference.
@Ray : Datatype I have used as Integer
@Chulett : Everywhere I have used Datastage sort . I was reading about psort and tsort, then I have tried this by developing sample job and saw the difference.
Soumya