|
Re: 如何把产生的各种随机数值赋给一个宏变量
[quote="jingju11":2egwjbym]%let 语句在data step里的用法说来话长。你的第二个程序是对的。京剧
[quote="sxlion":2egwjbym]最讨厌嵌套宏什么的。[/quote:2egwjbym][/quote:2egwjbym]
多谢大侠们的回帖啊,下边还有一种我们老师给的答案,虽然方法我认为没有前边大侠们给的好,不过还是一种有效的方法:
data c;
retain seed 0;
do i=1 to 150;
x1=rand('exponential');
x2=rand('uniform');
x3=rand('uniform');
Z=rangam(seed,2.5);
output;
end;
run;
data _null_;
set c;
call symputx ("xa_"||strip(put(_n_,best.)),x1);
call symputx ("xb_"||strip(put(_n_,best.)),x2);
call symputx ("xc_"||strip(put(_n_,best.)),x3);
call symputx ("zz"||strip(put(_n_,best.)),Z);
run; |
|