Sort utility in sort stage
Posted: Fri Apr 19, 2013 3:16 am
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?
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?