data b(drop=id year cnt1--cnt8 i);
set a end=last;
array r{8} a01--a15;
array cnt{8};
retain cnt1-cnt8 0;
do i=1 to 8;
if r(i)=.A then cnt(i)+1;
end;
if last then do;
do i=1 to 8;
r(i)=cnt(i);
end;
output;
end;
run;
[/code:328x35kq]作者: shiyiming 时间: 2008-4-27 04:08 标题: Re: 如何分别数多个变量的个数 谜面:告别烟酒生与巧克力较量, 告别烟酒生赢了。