sasuser2006
Technical User
I am needing help randomizing a data set in SAS. What i want to do is read in a data set and if you meet a certain criteria, select a random sample to put in one bucket and put the rest in another bucket.
Say 100 records have x > 10, i want a random 60 put in one data set and the rest put in another set.
data input; set random1;
if x > 10;
rand=ranuni(60);
proc sort data=input out=random1;
by rand;
run;
I know this isn't correct but can somebody help me modify this so it will achieve what I'm looking for? Thanks all.
Say 100 records have x > 10, i want a random 60 put in one data set and the rest put in another set.
data input; set random1;
if x > 10;
rand=ranuni(60);
proc sort data=input out=random1;
by rand;
run;
I know this isn't correct but can somebody help me modify this so it will achieve what I'm looking for? Thanks all.