Hi
I designed a simple job to sort 2 columns from hash file to seq file.
columns 1 key decimal(5) ex : 12345
column 2 varchar(9) ex 33510501U OR 33510501space.
i want to sort column 2 .i used sort stage and tried different options.but
it was not sorting correctly.can you share your thoughts.
thks
sai
sorting
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Varchar numbers and decimal numbers sort differently.
Decimal is obviously 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
Varchar is 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9
So what you might be seeing is unexpected sorting of your second column.
Please post more details if this does not answer your question.
Decimal is obviously 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
Varchar is 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9
So what you might be seeing is unexpected sorting of your second column.
Please post more details if this does not answer your question.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn