I want to create a variable want which is a randomly generated number following uniform distribution for dataset data. I want the number to be the same for all rows. I tried the following:
data data; set data; want = ranuni(0) ; run;
But this gives different value for each row.
I also tried to generate a macro variable then pass the value to the dataset, but I am struggling to make it work. Can anyone teach me how to do it please?
I tried the following:
%let want1= %ranuni(0) ;
I also tried:
%let want1= %eval ( ranuni(0) );
data data;
set data;
want = &want1;
run;