Can SSELECT command be used in the "Hashed File" S
Moderators: chulett, rschirm, roy
Hi there,
When I have a chance to reexamine the result, it seems sorted orderly, but in a different way. The key's type is SQL Integer, but it is sorted as string. The result is as the following. How can hashed file be sorted as Integer (coresponding to its key data type, not as string)?
Result:
1
10
100
10000
10001
...
10009
1001
10010
..
10019
1002
10020
..
The order I want is:
1
10
100
1001
1002
10000
10001
...
Thanks,
When I have a chance to reexamine the result, it seems sorted orderly, but in a different way. The key's type is SQL Integer, but it is sorted as string. The result is as the following. How can hashed file be sorted as Integer (coresponding to its key data type, not as string)?
Result:
1
10
100
10000
10001
...
10009
1001
10010
..
10019
1002
10020
..
The order I want is:
1
10
100
1001
1002
10000
10001
...
Thanks,
I would use a UV stage and a SQL SELECT. You can either fix the dictionary item or add one or use an EVAL.
Code: Select all
SELECT * FROM MyHashFile ORDER BY EVAL '"@ID" FMT '3R';
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can do this with a Hashed File stage. The sort phrase is augmented with the FMT field qualifier. You don't need EVAL if using a Hashed File stage.
Code: Select all
BY @ID FMT "10R"
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.