LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 9 Apr 2003 12:02:42 -0400
Reply-To:     John.Ladds@STATCAN.CA
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         John Ladds <John.Ladds@STATCAN.CA>
Subject:      Re: Sampling Question
Content-Type: text/plain; charset="iso-8859-1"

Try the following code:

**Create a random number; data theSample; set theData; seed=1234; drop seed; rn=ranuni(seed); run;

**Sort the dataset by the random number; proc sort data=theSample; by rn; run;

**Keep how ever many observations you need; data theSample; set theSample; drop rn; if _n_> 500; run;

John -----Original Message----- From: Action Man [] Sent: April 9, 2003 10:20 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Sampling Question

Hi Fellow SAS users;

I have 7,000 records in my SAS file. Out of these records I want to pick 500 of them randomly, How do I do that using SAS.

Thank you in advance.


_________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE*

Back to: Top of message | Previous page | Main SAS-L page