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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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