Date: Mon, 7 May 2001 20:30:22 -0400
Reply-To: dputnam@MERKLENET.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Darryl Putnam <dputnam@MERKLENET.COM>
Subject: Re: Randomly pick
Content-Type: text/plain; charset="iso-8859-1"
You are making things too hard
Try this
data select;
set auditing.recaudit;
rand=ranuni(8);
run;
proc sort data=select;
by rand;
run;
data FinalData;
set select (obs=5000);
run;
-----Original Message-----
From: Brian Vuong [mailto:brian-vuong@USA.NET]
Sent: Monday, May 07, 2001 5:56 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Randomly pick
Dear SAS users:
Please help me with random generator. After I ran codes listed below to
randomly pick 5000 records. I later found that in those 5000 records
consists of duplicates. Please show me to randomly pick 5000 records
without duplicates.
data select;
do i=1 to 400;
j= (ranuni(0)*total);
set auditing.recaudit point=j nobs=total;
output;
end ;
stop;
run;
Any help is greatly appreciated.
Regards,
Brian Vuong