|
沙发

楼主 |
发表于 2012-10-11 18:13:29
|
只看该作者
Re: 遇到难题,请帮忙!
[code:yhgtf0to]
options mlogic mprint symbolgen;
data g;
do i=1 to 2500;
x=ranuni(0);
y=ranuni(123456);
output;
end;
drop i;
run;
data g1 g2 g3 g4 g5;
set g;
if _n_<=100 then output g1;
else if 100<_n_<=200 then output g2;
else if 200<_n_<=300 then output g3;
else if 300<_n_<=400 then output g4;
else if 400<_n_<=500 then output g5;
run;
%macro sam(inds,outds);
proc surveyselect data=&inds
method=srs
rep=1
sampsize=100
seed=12345
out=&outds;
id _all_;
run;
%mend;
%macro ds;
%do j=6 %to 100;
%sam(g%eval(&j-1),t1)
%sam(g%eval(&j-2),t2)
%sam(g%eval(&j-3),t3)
%sam(g%eval(&j-4),t4)
%sam(g%eval(&j-5),t5)
data g&j;
set t1 t2 t3 t4 t5;
run;
%end;
%mend;
%ds
[/code:yhgtf0to] |
|