12-01-2015 11:11 AM
12-01-2015 11:50 AM
I would agree with @Reeza if you are trying to gather sample data sets, I would suggest utilizing the surveyselect procedure, as it will gather random samples of data. You could do something like the following to ensure you don't have the same observations in each of the six data sets:
proc surveyselect data=have out=want1 method=srs n=26; run; proc sql; create table remain1 as select A.* from have A left join want1 B on (A.ID=B.ID) Where B.ID=""; quit; proc surveyselect data=remain1 out=want2 method=srs n=26; run; proc sql; create table remain2 as select A.* from remain1 A left join want2 B on (A.ID=B.ID) Where B.ID=""; quit; . . .
However, if you want to just create six different data sets with 26 observations in each (sequentially) the following code would do it:
data want1; set have nobs=26; run; data want2; set have (firstobs=27 obs=26); run; data want3; set have (firstobs=54 obs=26); run; data want4; set have (firstobs=81 obs=26); run; data want5; set have (firstobs=108 obs=26); run; data want6; set have (firstobs=135 obs=26); run;
12-01-2015 11:59 AM