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 (May 2012, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 15 May 2012 12:17:20 -0400
Reply-To:     Rick Wicklin <Rick.Wicklin@SAS.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Rick Wicklin <Rick.Wicklin@SAS.COM>
Subject:      Re: SAS random record selection

I echo Dan's suggestion to read David Cassell's paper. If you decide you need columns, try this for an outline. I'll use a data set with obs 1-N:

data a; do i = 1 to 20; output; end; run;

proc surveyselect data=a method=urs sampsize=5 reps=10 outhits outall out=b; run;

Note the use of the OUTHITS option, as well as the OUTALL option suggested by Joe. The OUTHITS option creates a frequency variable named NumberHits, which will probably be more useful to you than an indicator variable, since an obs can be selected multiple times for some METHOD= choices.

The data set B is in long format. You can use PROC TRANSPOSE or other SAS tricks to convert it to a wide format. I'll let others advise you on that,

Rick Wicklin


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