问题出在sql那里,感觉是特殊符号问题,求助
data _null_;
set age;
suffix=put(_n_,5.);
call symput(cats('year',suffix), year);
call symput(cats('m',suffix),month);
call symput('x',x);
call symput(cats('amount',suffix),amount);
run;
%macro test;
%do i=1 %to &x;
proc sql;
create table result&i as select*,
max (case when (dr=&amount and m=&m and year=&y) then 10 else 0 end) as zz from yijia1 group by code1 having zz=10;
quit;
proc sort data=result&i;
by descending date;
run;
%end;
%mend test;
%tes