proc sql noprint;select count(*) into: n from aa1;quit;
%macro create;
%do i=1 %to &n;
%if %sysfunc(mod(&i,3))=0 %then %do;
data temp%sysfunc(compress(%eval(&i/3)));
set temp;
if _n_>%eval(&i-3) and _n_<=&i then output;
run;
%end;
%end;
%mend create;
%create;