data var3;
set comb10_3;
length %varlist(3);
%varassign(3);
run;作者: shiyiming 时间: 2011-7-5 00:53 标题: Re: 我的程序那里出错了,为什么的VAR1值总是MISSING %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;