如果你的数据集 a , 有一个变量 x, x 有201 个值, 你想生成1000000个随机数就在x的201个数据中取,
ranuni( ) 就让你抽到的机会相等,point= 告诉SAS在哪抽,stop 必须用,如果你用 point=.
data b;
do samples=1 to 1000000;
obs_pointer=ceil (ranuni(0)*201);
set a point=obs_pointer;
output;
end;
stop;
run;
proc print data=b (obs=1000);
run;
**please try smaller sample first, before you use samples=1 to 1000000, it is too big**;