Dear SAS users, I am generating samples using SURVEYSELECT and then running PROC GLM with a BY command, all of this in a MACRO to save the results in indivudal files. I want the repetition variable, which goes from 1... n in each iteration to start where the other iteration left off. So: if i=1 then rep=1, ...,5 if i=2 then rep=6,...10 if i=3 then rep=11...15 etc. I would make the REP option in my code equal to REP=(&i*&rep)+&rep which would give me this result, but that doesn't seem to be recognized as a symbol. Any ideas on how to achieve the same result? %macro do_survey;
options mprint symbolgen;
%do i=0 %to 2;
proc surveyselect data=claims out=bootsample
seed = 1347 method = urs
samprate = 1 outhits rep =(&i*&rep)+&rep;
run;
ods listing close;
proc glm data=Bootsample;
class year(ref='2010' ) age_gr (ref='0' );
model indavgcost= year|avgcontract/ solution;
TITLE "ALL HOSPITALS-indavgcost";
by replicate;
ods output ParameterEstimates=work.t_&i;
run;
data t_&i;
set t_&i;
keep replicate parameter estimate;
run;
data t_&i;
set t_&i;
if estimate=0 then delete;
run;
proc datasets;
append base=t1 data=t_&i force;
run;
quit;
%end;
%mend do_survey;
%do_survey;
... View more