07-29-2014 10:11 AM
Hello, first time user for a couple of weeks now and have an issue with the SORT function.
When I sort by var (which is numeric, 1 until 13) I get:
In my other similar database I didn't have this issue, strange. Anyone knows how to fix this? Here's the basic code:
Proc sort data = data out = sorteddata;
07-29-2014 10:43 AM
I just ran a PROC CONTENTS and you're right. I find it strange it switched to Char, since it was Num in my main database, but thanks!
07-29-2014 10:34 AM
There is an option in proc sort can do that ,you need to check documentation . another way is sql.
Here is :
Message was edited by: xia keshan
07-29-2014 11:26 AM
Where do I put this in my code? Just out of curiosity. I just changed my variable to numeric by multiplying it by 1 now. Thanks.
07-30-2014 09:01 AM
data test; length v $ 3; input v; cards; 1 10 11 12 13 2 3 4 5 6 ; run; proc sort data=test sortseq=linguistic(numeric_collation=on); by v; run; proc print data=test; run;
Need further help from the community? Please ask a new question.