wwang111 发表于 2016-7-22 21:06
我是怕你记录数太多,产生很多code,保险起见,长度只要够用就好,你可以根据具体数据调整
我执行命令的时候报错说数值型变量的长度为3-8,后面的命令就没法执行了。
data re06;
set re05 end=last;
length _code 100code 2100;
retain code;
array item item:;
do i=1 to dim(item);
if item="其他" then vname=vname(item);
end;
if vname ne '' then num=input(compress(vname,,'a'),best.)+1;
if .<num<=&itemnum
then _code='if stkcd='||cat(stkcd)||' then call missing(of item'||cat(num)||"-item&itemnum);";
if _n_=1 then code=_code;
else code=strip(code)||strip(_code);
if last then do;
call execute('data wanted;set test;');
call execute(code);
call execute('run;');
end;
run;
这是我根据您的命令修改的,麻烦您帮忙看一下哪里有问题。
总data有2000多条观测。