现在我想排除其中包含汉字的纪录,只保留如'1110'这种纯数字的纪录。
不知道sas代码怎么实现,请各位xdjm帮帮忙作者: shiyiming 时间: 2007-6-7 00:08 标题: Re: sas问题求助!! data a;
set b;
if substr(x,1,1) not in ('0','1','2','3','4','5','6','7','8','9') then delete;
run;作者: shiyiming 时间: 2007-6-8 11:56 标题: to swarp Hi,
The best method to verify the string is numberic or not is compress function.
Please see the code below:
[code:ec8b8]data a;
input test $4.;
if (missing(compress(test,,'d'))) then output;
datalines;
0011
1101
2101
广文
南字
;
proc print data=a;
run;[/code:ec8b8]作者: shiyiming 时间: 2007-6-25 15:26 标题: Re: sas问题求助!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> 谢谢大家,问题已经成功解决作者: shiyiming 时间: 2007-6-25 16:20 标题: Re: to swarp [code:6ddf1]
if compress(test,,'kd') then output
[/code:6ddf1]
hehe