BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zhaosi
Fluorite | Level 6

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;

1 ACCEPTED SOLUTION

Accepted Solutions
zhaosi
Fluorite | Level 6

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;

View solution in original post

2 REPLIES 2
zhaosi
Fluorite | Level 6

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;

zhaosi
Fluorite | Level 6

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;

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1725 views
  • 0 likes
  • 1 in conversation