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 (November 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 25 Nov 2004 12:41:13 -0500
Reply-To:     "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Subject:      Re: random partitions

jlamack wrote: > Dear all, I have a sas data set with 40 observations. > I would like to get 8 random partitions of size 5 of this sas data > set. Please, How can I do this?? >

Sort by random, then group by order

data _40; do rowid = 1 to 40; output; end; run;

proc sql; create view ran40 as select * from _40 order by ranuni(0); quit;

data _40_8x5; set ran40; group = floor((_n_-1) /5); run;

-- Richard A. DeVenezia http://www.devenezia.com/


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