data SubData;
nSample=13560;
do i=1 to nSample;
nRan=ceil(ranuni(1)*nTotal);*if seed ^=0 then repeated sample is identical,if seed =0 then repeated sample is random;
set oldData point=nRan nobs=nTotal;
output;
end;
stop;
run;
*i find that if the old data having many columns, the code is so inefficient;作者: shiyiming 时间: 2009-5-1 11:32 标题: Re: 请教一个随机取数的问题,谢谢! deshenshu做的也是放回抽样。
因为频繁IO, 所以可以使用sasfile open, array, hash等方法将数据保存在内存当中,若不是硬盘中~~