|
楼主

楼主 |
发表于 2011-7-4 23:12:19
|
只看该作者
我的程序那里出错了,为什么的VAR1值总是MISSING
%macro comb(n=,m=);
ods output plan=comb&n._&m.;
ods listing close;
proc plan;
factors block=%eval(%sysfunc(comb(&n.,&m.))) ordered
treat= &m. of &n. comb
;
run;
quit;
ods listing;
ods output close;
%mend;
%comb(n=10, m=1)
%comb(n=10, m=2)
%comb(n=10, m=3)
%comb(n=10, m=4)
%comb(n=10, m=5)
%comb(n=10, m=6)
%comb(n=10, m=7)
%comb(n=10, m=8)
%comb(n=10, m=9)
%comb(n=10, m=10)
%MACRO varlist(m);
%DO I = 1 %TO &m;
var&I $10
%END;
%MEND varlist;
%MACRO varassign(m);
%do i=1 %to &m;
%if treat&i=1 %then var&i=year_2;
%else %if treat&i=2 %then var&i=year_3;
%else %if treat&i=3 %then var&i=hydro;
%else %if treat&i=4 %then var&i=nuke;
%else %if treat&i=5 %then var&i=wind;
%else %if treat&i=6 %then var&i=biomass;
%else %if treat&i=7 %then var&i=estcp_pc;
%else %if treat&i=8 %then var&i=gdp;
%else %if treat&i=9 %then var&i=solar;
%else %if treat&i=10 %then var&i=ngeid;
%end;
%mend varassign;
data var3;
set comb10_3;
length %varlist(3);
%varassign(3);
run; |
|