如果变量特别多不能一一写出来 我只能想到一种比较笨的方法基本可以通用 即用sas字典关于变量的记录来编程
data have;
input name $ a b c d e f g h i j k;
cards;
we 1 2 0 1 0 0 0 0 0 0 0
yu 1 1 1 1 0 0 0 0 0 0 0
wu 0 0 0 0 0 0 0 0 0 0 0
fw 0 0 1 0 0 0 0 0 -1 0 0
;
run;
proc sql;
select count(name) into : count ,name into :
var separated by ' ' from sashelp.vcolumn
where libname='WORK' and memname=upcase('have') and type='num';
quit;
data want(drop=total);
set have;
array dd &var;
total=0;
do over dd;
if dd=0 then total+1;
end;
if total=&count then delete;
run;