问题描述:
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呢?
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呢?
问题解答:
我来补答展开全文阅读