Page 1 of 1

sorting

Posted: Wed Apr 26, 2006 3:48 pm
by sainath
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

Posted: Wed Apr 26, 2006 4:26 pm
by vmcburney
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.