Hi All, I am trying to understand the RANUNI function. Trying to create a dataset using RANUNI For Ex. I have a Dataset ACCOUNTS having the below-mentioned variables ACCT_NUM, AFLAG RF1, RF2, RF3, RF4 rf2cnts 0000000001 0 0 1 1 1 1 0000000004 0 1 1 1 1 1 0000000005 0 0 0 0 1 0 000000300 0 0 0 0 0 0 I am using the below code to get a size and assign 1 rf2,rf3, and rf4 respectively if the value is 1 in a new variable (for eg. rfn) data rf2 (drop = x n);
set accounts;
n = ranuni(5);
retain x 1;
if rfcnts eq 1 and x = 10 then do; * x = 10 number of rf2 needed with 1;
rf2f = 1;
x+1;
end;
else do;
rf2f = 0;
end;
run; I am trying to understand when I run the same data step on the same dataset will the value of N change, have tried running the data step on the same dataset a couple of times but every 10-15 mins I still see the value of N is same. is this how it should be or change every time I run the data step with RANUNI in it and on the same dataset with the same values and size? Kindly note I don't want to use SurveySelect, please see the output attached where we have unchanged values of N. Kindly suggest. Regards, S
... View more