|
%macro result(m);
data a;
set case;
where didian=&m.;
call symput("min"||left(_n_),min);
call symput("max"||left(_n_),max);
run;
data b;
set control;
where didian=&m.;
run;
%mend result;
%macro crackman(min,max,out);
data woody;
set b;
where age>&min. and age<&max.;
run;
proc surveyselect data=woody method=srs rep=1 sampsize=1 seed=5488 out=&out. noprint;
id _all_;
run;
data _null_;
set &out.;
call symput("id",id);
run;
data b;
set b;
where id^=&id.;
run;
%mend crackman;
%macro crackman1(n);
%do i=1 %to &n.;
%result(&i.);
%do j=1 %to &n.;
%crackman(&&min&j.,&&max&j.,a&j.);
proc append base=c data=a&j.;
run;
%end;
%end;
proc datasets library=work nolist;
delete a1-a10;
run;
quit;
%mend crackman1;
%crackman1(10);
|