Regardless of which style macro you choose, do realize that using the ranuni function via a macro will ALWAYS return the first number in that seed .. i.e., NOT a random number.
e.g., run the following code and compare the output files (i.e., dontwant and want):
%macro random_number2(seed);
%local value;
%let value=%sysfunc(ranuni(&seed),best32.);
&value.
%mend;
data dontwant;
do i=1 to 100;
x=%random_number2(0);
output;
end;
run;
data want;
do i=1 to 100;
x=ranuni(0);
output;
end;
run;
Art, CEO, AnalystFinder.com
... View more