第一问:
%macro a;
data result;set a1;length id $20 obs 8;stop;run;
%do i=1 %to n;
data temp;set a&i;s+c;if s>10 then do;id="a&i";obs=_n_;output;stop;end;drop s;run;
proc append base=result data=temp;run;
%end;
%men a;%a;
第二问:
%macro b;
%do i=1 %to n;
data _null_;set a&i(obs=2) end=last;if c<=10 then do;call execute("proc delete data=b&i;run;");stop;end;if last then 汇总;run;
%end;
%mend b;
%b