Hi:
I want to use "ods select LIFETEST" to select the Survival figure and output it to the rtf file. The code as follow. When I submit it the first time. It can work. But when I submit it again. It can't work. I check it in the Results Window. Click the Survival Properties. I found that the first time submit name is LIFETEST. The second is LIFETES1. When I submit the code more times. It will named:LIFETES2,LIFETES3,LIFETES4...and so on. So my question is: Do SAS has a method to make the results attribute name same no matter how many times I submit the code. My English is not good. Thanks!
DATA SA; INPUT T@@;
IF T<0 THEN CENSOR=1;
ELSE CENSOR=0;
IF _N_>16 THEN GROUP=2;
ELSE GROUP=1; T=ABS(T);
CARDS;
-2 4 -6 -6 -7.5 8.5 -9 10 -12 13 18 -19 24 26 31
-43 1.5 -2 3.5 6 6.5 -6.5 11 -11 13 17
;
run;
ods rtf file='D:/temp.rtf' bodytitle;
PROC LIFETEST METHOD=PL PLOT=(S);
TIME T*CENSOR(1);
STRATA GROUP;
RUN;
ods rtf close;
Hi:
I solved it myselft! Thank you all the same. The command "noprint" is OK and do not use ods select. Actually I still think out another method. Using: ods exclude. But this method seems more trouble.
DATA SA;
INPUT T@@;
IF T<0 THEN CENSOR=1;
ELSE CENSOR=0;
IF _N_>16 THEN GROUP=2;
ELSE GROUP=1; T=ABS(T);
CARDS;
-2 4 -6 -6 -7.5 8.5 -9 10 -12 13 18 -19 24 26 31
-43 1.5 -2 3.5 6 6.5 -6.5 11 -11 13 17
;
run;
title;
options nodate nonumber;
ods rtf file='D:/temp.rtf' bodytitle;
PROC LIFETEST METHOD=PL PLOT=(S) noprint;
TIME T*CENSOR(1);
STRATA GROUP;
RUN;
ods rtf close;
Hi:
I'm sorry I forget some code.
DATA SA;
INPUT T@@;
IF T<0 THEN CENSOR=1;
ELSE CENSOR=0;
IF _N_>16 THEN GROUP=2;
ELSE GROUP=1; T=ABS(T);
CARDS;
-2 4 -6 -6 -7.5 8.5 -9 10 -12 13 18 -19 24 26 31
-43 1.5 -2 3.5 6 6.5 -6.5 11 -11 13 17
;
run;
ods select LIFETEST;
ods rtf file='D:/temp.rtf' bodytitle;
PROC LIFETEST METHOD=PL PLOT=(S);
TIME T*CENSOR(1);
STRATA GROUP;
RUN;
ods rtf close;
Hi:
I solved it myselft! Thank you all the same. The command "noprint" is OK and do not use ods select. Actually I still think out another method. Using: ods exclude. But this method seems more trouble.
DATA SA;
INPUT T@@;
IF T<0 THEN CENSOR=1;
ELSE CENSOR=0;
IF _N_>16 THEN GROUP=2;
ELSE GROUP=1; T=ABS(T);
CARDS;
-2 4 -6 -6 -7.5 8.5 -9 10 -12 13 18 -19 24 26 31
-43 1.5 -2 3.5 6 6.5 -6.5 11 -11 13 17
;
run;
title;
options nodate nonumber;
ods rtf file='D:/temp.rtf' bodytitle;
PROC LIFETEST METHOD=PL PLOT=(S) noprint;
TIME T*CENSOR(1);
STRATA GROUP;
RUN;
ods rtf close;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: