Dear SAS experts :
I'm trying to conduct a stratified analysis by age groups with 4 levels and use resulting ALL_MODEL data for a plotting purpose at the end. However, I get an error:
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.MODEL0_AGE1 may be incomplete. When this step was stopped there were
0 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time
I think the way I'm trying to loop %DO N=1 %TO 4 is wrong.
Any suggestions to correct the code below? Thanks for your time in advance.
%SYMDEL;
%macro models (PAR_MID,duration,AGEGRP);
%DO N=1 %TO 4;
ODS OUTPUT ParameterEstimates=&PAR_MID;
PROC PHREG DATA = HAVE;
CLASS STAGE(REF='1')/PARAM=REF;
MODEL duration*EXIT(0) = STAGE/RL EVENTCODE=1;
WHERE AGEGRP=&N;
%END;
RUN;
%LET MODEL=&PAR_MID;
DATA &PAR_MID; SET &PAR_MID;
LENGTH MODEL $15.;
MODEL="&PAR_MID";
RUN;
%MEND MODELS;
%MODELS(MODEL0_AGE1,dur_MODEL01);
%MODELS(MODEL0_AGE2,dur_MODEL02);
%MODELS(MODEL0_AGE3,dur_MODEL03);
%MODELS(MODEL0_AGE4,dur_MODEL04);
%MODELS(MODEL5_AGE1,dur_MODEL5_1);
%MODELS(MODEL5_AGE2,dur_MODEL5_2);
%MODELS(MODEL5_AGE3,dur_MODEL5_3);
%MODELS(MODEL5_AGE4,dur_MODEL5_4);
%MODELS(MODEL25_AGE1,dur_MODEL25_1);
%MODELS(MODEL25_AGE2,dur_MODEL25_2);
%MODELS(MODEL25_AGE3,dur_MODEL25_3);
%MODELS(MODEL25_AGE4,dur_MODEL25_4);
%MODELS(MODEL50_AGE1,dur_MODEL50_1);
%MODELS(MODEL50_AGE2,dur_MODEL50_2);
%MODELS(MODEL50_AGE3,dur_MODEL50_3);
%MODELS(MODEL50_AGE4,dur_MODEL50_4);
%MODELS(MODEL75_AGE1,dur_MODEL75_1);
%MODELS(MODEL75_AGE2,dur_MODEL75_2);
%MODELS(MODEL75_AGE3,dur_MODEL75_3);
%MODELS(MODEL75_AGE4,dur_MODEL75_4);
%MODELS(MODEL100_AGE1,dur_MODEL100_1);
%MODELS(MODEL100_AGE2,dur_MODEL100_2);
%MODELS(MODEL100_AGE3,dur_MODEL100_3);
%MODELS(MODEL100_AGE4,dur_MODEL100_4);
DATA ALL_MODEL; SET MODEL:;
KEEP Estimate HRLowerCL HRUpperCL HazardRatio Label MODEL PERCENT;
PERCENT=SUBSTRN(MODEL,6,7);
RUN;
Is there some particular reason you don't want to use BY group processing to produce output for each age group?
Is there some particular reason you don't want to use BY group processing to produce output for each age group?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.