Hi Rich, data a; set sashelp.class nobs=aee; a=ceil(_n_/(aee/4)); b=put(a,words23.); run; proc sort data=a; by b; run; data a13; set a ; call symput("bc"||compress(_n_),b); run; %macro a(bc,i); %do &i= 1 %to 19; data &&bc&&i.; set a; by b; if _n_= &i. then output &&bc&&i.; %end; run; %mend; %a(b,i,) here I'm getting 19 datasets same way I need all the 1,2 3,4 in different datasets
... View more