由买买提看人间百态

topics

全部话题 - 话题: outvar
(共0页)
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;
h******e
发帖数: 1791
2
我的问题是这样的:
用proc means计算dataset里所有numeric variable的sum,sas code为:
output out = out sum(v_1 -- v_last) = sum1 - sum&outvar;
&outvar代表着variable的总数。
(共0页)