s********p 发帖数: 637 | 1 %let outvar=;
%macro cal_var_nums(indata);
proc contents data=&indata out=out noprint; run;
proc sql noprint;
select count(name) into :outvar
from out
;
quit;
%mend;
%cal_var_nums(model(obs=0));
%put "Total variable:" &outvar;
%cal_var_nums(model(obs=0 keep=_NUMERIC_ ));
%put "Num variable:" &outvar;
%cal_var_nums(model(obs=0 keep=_CHARACTER_ ));
%put "Char variable:" &outvar; |
|