@Gustavo8:
As suggested by @PaigeMiller and @unison, generate the entire thing using REPS=100. I can't imagine why you would need to split it into 100 chunks but if you really want to do it dynamically in a single step, the hash object is your best friend. Note that below REP=5 is used instead of 100 for the sake of sanity.
data have ;
do i = 1001 to 1050 ;
x = 0 ; b + 2 ; dummy + 1 ;
output ;
end ;
run ;
proc surveyselect noprint data=have out=samples method=pps sampsize=25 reps=5 ;
size b ;
run ;
data _null_ ;
if _n_ = 1 then do ;
dcl hash h (dataset:"samples(obs=0)", multidata:"y", ordered:"a") ;
h.definekey ("replicate") ;
h.definedata (all:"y") ;
h.definedone () ;
end ;
do until (last.replicate) ;
set samples ;
by replicate ;
h.add() ;
end ;
h.output (dataset: "sample" || put (_n_, z3.)) ;
h.clear() ;
run ;
The output data set names are auto-created as sample001, sample002, et al. to make them appear properly sorted by name when viewed in the library. You can change that and/or shape the names the way you want by editing the character expression assigned to the DATASET argument tag in the OUTPUT method call.
Kind regards
Paul D.
... View more