Hi Folks:
I'm trying to understand proc append in the given context below. I have a simulation study going on and got the problem solved in terms of executing it in SAS (see link below). The SAS program for simulation included 'proc append' as shown below.
proc append base=results_combined data=PE1 force nowarn;
run;
proc append base=results_summary data=pe_summary force nowarn;
run;
My question is, what are being achieved by these two proc appends? I read SAS documentations on proc append and a SUGI paper as well.
To understand better, I ran proc contents as following on the datasets specified after base= and data=. However, the dataset pairs are identical. Is proc append being used here just to change the name of the dataset from PE1 to results_combined and pe_summary to results_summary?
Thanks for your help! I appreciate your time.
proc contents data=results_combined; run;
proc contents data=PE1; run;
proc contents data=results_summary; run;
proc contents data=pe_summary; run;
Previous post where simulation problem was solved by Reeza.
https://communities.sas.com/t5/SAS-Programming/Simulate-parameter-estimates-of-the-model-for-missing-scenarios/m-p/565095#M158585
Whole program for a simulation taking from the link of the post above.
%symdel;
%macro surveyLoop(sample=);
*calculate sample rate; %let sampRate = %sysevalf(&sample./100);
*create sample;
ods select none;
proc surveyselect data=method
samprate=&sampRate.
reps=100
out=_sample
seed=&sample
outall;
strata stage;*ensures stage is present for all values - not needed in prod;
run;
*set duration to values if selected;
data _sample;
set _sample;
*assign values as needed;
if selected = 1 and method=0 then dur_loop = DUR_MID; else
if selected = 0 and method=0 then dur_loop = DUR_GOLD; else
if selected=1 and method=1 then dur_loop=DUR_GOLD; else
if selected=0 and method=1 then dur_loop=DUR_GOLD;
run;
*sort for modeling procedures next;
options nonotes;
proc sort data=_sample;
by replicate stage AGEGRP;
run;
ods output ParameterEstimates=PE;
PROC PHREG DATA=_sample;
by replicate stage AGEGRP;
MODEL DUR_LOOP*DEATH(0)=METHOD/RL;
RUN;
DATA PE1; SET PE;
PCT_MISS = &sample/100;
run;
*omit if no replicates;
*if replicates calculates average of HR + STDERR for bootstrap approach;
proc means data=PE1 NWAY N MEAN STD STDERR;
class STAGE AGEGRP pct_miss;
var hazardratio HRLowerCL HRUpperCL;
ods output summary = pe_summary(keep=stage agegrp pct_miss HazardRatio_Mean HRUpperCL_Mean HRLowerCL_Mean);
run;
ods select all;
proc append base=results_combined data=PE1 force nowarn;
run;
proc append base=results_summary data=pe_summary force nowarn;
run;
quit;
proc datasets lib=work nodetails nolist;
delete _SAMPLE Results_combined;
run; quit;
%let sampRate =;
%mend;
%surveyLoop(sample=1);
%surveyLoop(sample=2);
through...
%surveyLoop(sample=100);
@Reeza
... View more