sas中anyalnum函数

问题描述:

sas中anyalnum函数
Anyalnum函数的应用 Scanning a String from Left to Right;
data _null_;
string='Next = Last + 1';
j=0;
do
until(j=0);
j=anyalnum(string,j+1);
if j=0 then put +3
"That's all";
else
do;
c=substr(string,j,1);
put +3
j= c=;
end;
end;
run;
The following lines are written to the SAS log:
j=1 c=N j=2 c=e j=3 c=x j=4 c=t j=8 c=L j=9 c=a j=10 c=s j=11 c=t j=15 c=1 That's all.
这个程序有点看不明白,为什么j后来会等0呢?
1个回答 分类:综合 2014-09-28

问题解答:

我来补答
anyalnum(string, j+1)返回string中从j+1位置开始第一个字母或者数字的位置.当j+1的长度大于string的长度时,返回0,并赋值到j
 
 
展开全文阅读
剩余:2000
上一页:解题方法 技巧
下一页:过程3