« Importing files in SAS | Main | Using Patch and Diff »

January 18, 2013

Create random number string in SAS

Adapted code from here

%let NObs = 52;

data test_psid(keep=psid);
call streaminit(123); /* random num generator seed*/
Min = 100000; Max = 999999; /*range of random number*/
do i = 1 to &NObs;
psid = min + floor((1+Max-Min)*rand("Uniform")); /* uniform integer in Min..Max */
output;
end;
run;

Posted by kkwaiser at January 18, 2013 10:08 AM

Comments

Login to leave a comment. Create a new account.