sorting

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

sorting

Post 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
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post 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.
Post Reply