l**********s 发帖数: 255 | 1 我的数据如下(data three),想把数据从小到大排序,变成data four那样,但是数据类
型不是数字型,我能想到的办法就是把变量变成数字型的(trim),然后排序。有牛牛们
没有更简单的办法?多谢。
data three;
input name $1-5;
datalines;
a1b10
a1b11
a1b12
a1b1
a1b2
a1b3
;
run;
******************************
data four----
a1b1
a1b2
a1b3
a1b10
a1b11
a1b12 | c**d 发帖数: 104 | 2 你可以看看help:PROC SORT DATA= SORTSEQ=;
SAS9.2中的新option
【在 l**********s 的大作中提到】 : 我的数据如下(data three),想把数据从小到大排序,变成data four那样,但是数据类 : 型不是数字型,我能想到的办法就是把变量变成数字型的(trim),然后排序。有牛牛们 : 没有更简单的办法?多谢。 : data three; : input name $1-5; : datalines; : a1b10 : a1b11 : a1b12 : a1b1
| s*******f 发帖数: 148 | 3 Try this~
PROC SORT DATA=three OUT=temp
SORTSEQ=LINGUISTIC(NUMERIC_COLLATION=ON);
BY name;
RUN;
Reference: http://support.sas.com/resources/papers/proceedings09/142-2009.pdf
【在 l**********s 的大作中提到】 : 我的数据如下(data three),想把数据从小到大排序,变成data four那样,但是数据类 : 型不是数字型,我能想到的办法就是把变量变成数字型的(trim),然后排序。有牛牛们 : 没有更简单的办法?多谢。 : data three; : input name $1-5; : datalines; : a1b10 : a1b11 : a1b12 : a1b1
| l**********s 发帖数: 255 | | l**********s 发帖数: 255 | 5 I tried but the code did not work. I also read the article, it seems there
is nothing wrong with the code, do you know why? Here is the log section:
PROC SORT DATA=three OUT=temp
32 sortseq=linguistic(Numeric_Collation=ON);
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, ASCII, BUFFNO
, DANISH, DATA,
DATECOPY, DETAILS, DIAG, DUPOUT, EBCDIC, EQUALS, FINNISH,
FORCE, IN, ISA, L,
【在 s*******f 的大作中提到】 : Try this~ : PROC SORT DATA=three OUT=temp : SORTSEQ=LINGUISTIC(NUMERIC_COLLATION=ON); : BY name; : RUN; : Reference: http://support.sas.com/resources/papers/proceedings09/142-2009.pdf
| D******n 发帖数: 2836 | 6 sas too old?
BUFFNO
【在 l**********s 的大作中提到】 : I tried but the code did not work. I also read the article, it seems there : is nothing wrong with the code, do you know why? Here is the log section: : PROC SORT DATA=three OUT=temp : 32 sortseq=linguistic(Numeric_Collation=ON); : - : 22 : 76 : ERROR 22-322: Syntax error, expecting one of the following: ;, ASCII, BUFFNO : , DANISH, DATA, : DATECOPY, DETAILS, DIAG, DUPOUT, EBCDIC, EQUALS, FINNISH,
| l**********s 发帖数: 255 | 7 YES!!i Just realized this and checked ---mine sas is 9.1!!!!
want to cry!!
【在 D******n 的大作中提到】 : sas too old? : : BUFFNO
|
|