data a;
do unit=1 to 20;
if (unit <= 4) then group=1;
else if (unit <= 8) then group=2;
else if (unit <= 12) then group=3;
else if (unit <= 16) then group=4;
else group=5;
output;
end;
run;
proc plan seed=0710;
factors unit=20;
output data=a out=b;
run;
quit;
data RV;
do i = 1 to 17;
c=rannor(0);
output;end;
run;
proc sort data=rv;by c;run;
data _null_;
set rv end=a;
if a then call symput('total',ceil(_n_/5));
run;
data rvv;
set rv;
do i=1 to &total;
if ceil(_n_/5)=i then p=i;
end;
run;
data a (drop=i);
do i=1 to 30;
x=rannor(123);
ind=ranuni(123);
if ind<=.20 then group=1;
else if ind>.20 and ind<=.40 then group=2;
else if ind>.40 and ind<=.60 then group=3;
else if ind>.60 and ind<=.80 then group=4;
else group=5;
output;
end;
run;