Hi all,
I'm struggling with my ods pdf TOC when using PROC LIFETEST along with ODS SELECT.
Beside the text defined in the ODS PROCLABEL statement, I get a second line in the TOC named "Survival Curves" which refers to the same graph. Can I get rid of it?
ods pdf output='mypath\filename.pdf' style = journal contents=on pdftoc = 1;
ods graphics on;
ods listing gpath='mypath';
ods graphics / imagename="g_tte_1" imagefmt=png;
ods noproctitle;
ods proclabel = 'Figure 14.2.2.59 Kaplan-Meier Plot of Time to XXX';
ods select survivalPlot;
proc lifetest data=mydat plots =(survival(atrisk(outside(0.15)) test));
time T*censor(0);
strata group;
run;
ods graphics off;
ods pdf close;
Bari Lawhorn has a great paper on PDF TOC: https://support.sas.com/resources/papers/proceedings11/252-2011.pdf
She presented it as a webinar to BASUG last year.
The slides are: https://www.basug.org/_files/ugd/6fce8c_aba2be0893314fa3bb3ca2c22fc1fc90.pdf
The recoding is: https://www.basug.org/videos?wix-vod-video-id=a17c9abb623e4f64b2ef843b0589dad3&wix-vod-comp-id=comp-...
ods document name=testAW(write);
ods select survivalPlot;
proc lifetest data=sashelp.bmt ;
time T*status(0);
strata group;
run;
ods document close;
proc document name=testAW;
list/ levels=all; run;
quit;
proc document name=testAW2(write);
setlabel \work.testAW\Lifetest#1\SurvivalPlot#1 "Figure 14.2.2.59 Kaplan-Meier Plot of Time to XXX";
copy \work.testAW\Lifetest#1\SurvivalPlot#1 to ^; /*copy to current directory*/
run;
list/ levels=all; run;
quit;
/*Create the desired PDF file*/
proc document name=work.testAW2;
ods pdf file="c:\temp\want.pdf" style = journal contents=on pdftoc = 1;
replay;
run;
ods pdf close;
quit;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.