Yes. It can be done easily. You don't even need to have the variable names in advance.
See example below. All b's are missing of all values.
data t1;
retain b1-b100 .;
retain a1-a5 1;
retain c 'c';
do i=1 to 10;
output;
end;
run;
proc means data=t1 noprint;
var _numeric_;
output out=check(drop=_:) nmiss= ;
run;
data _null_;
if 0 then set t1 nobs=nobs;
set check;
array var_names(*) _numeric_;
do i=1 to dim(var_names);
if var_names(i)=nobs then do;
variable_name=vname(var_names(i));
put "variable_name=" variable_name;
end;
end;
run;


雷达卡
京公网安备 11010802022788号







