HI: Aside from any page break issues, if you look at the output files from the attached program, you will see the TOC level customization that you can do with ODS PROCLABEL and CONTENTS= with PRINT, REPORT, TABULATE and FREQ. If you use ODS PROCLABEL, you are explicitly telling ODS what is the text string for labelling the top level node that should be placed in the TOC. Without any ODS PROCLABEL information, the procedure determines the text that goes into the TOC. And even with ODS NOPTITLE in effect, the titles used for PRINT and REPORT in the first output's TOC are: The PRINT Procedure and The REPORT Procedure. This means that, in the first (smaller) example below, the TOC reflects the names that the procedures send (and not the SAS TITLES) -- so there never been an automatic way to put the SAS title into the TOC. If you made your ODS PROCLABEL value the SAME as your SAS title, then it might appear as though the title is being used. In my second example, I made the ODS PROCLABEL string and the TITLE different so you could see exactly which string was used in the TOC. That takes care of the "top level" for each step in the TOC. The secondary levels you may or may not have control over. PRINT, REPORT, TABULATE and FREQ all support the use of CONTENTS= option to change at least one of the secondary (or tertiary) level strings. To rearrange or restructure your TOC completely, usually requires using ODS DOCUMENT and PROC DOCUMENT. So, for example to "flatten" the structure of the TOC or eliminate levels, you can play around with CONTENTS=' ' (quote space quote) to suppress levels, but sometimes, that doesn't completely suppress the level, just blanks out the string for the level. ODS DOCUMENT is the best way to rearrange and restructure your output so the TOC is the way you want. Code below does not venture into ODS DOCUMENT territory. There have been many previous examples of that posted in the forum and at past user group site. But the code below does illustrate the use of ODS PROCLABEL in conjunction with CONTENTS=. To keep things simple and unmuddied, I did not get into STARTPAGE issues. cynthia ** default -- show only 2 procedures; ** by default, titles are not inserted into the TOC; ods tagsets.rtf file='c:\temp\show_toc_defaults.rtf' options(contents='yes' toc_data='yes' sect='no'); ods noptitle; title '1) Title'; proc print data=sashelp.shoes(obs=5); var product region sales inventory returns; run; title '2) Title'; proc report data=sashelp.cars(obs=5) nowd; column make model type drivetrain msrp; run; ods _all_ close; **shows use of ods proclabel and contents=; ods tagsets.rtf file='c:\temp\showproclabel.rtf' options(contents='yes' toc_data='yes' sect='no'); ods noptitle; ods proclabel 'One'; title '1) Title'; proc print data=sashelp.shoes(obs=5) contents='Proc Print Top'; var product region sales inventory returns; run; ods proclabel 'Two'; title '2) Title'; proc report data=sashelp.cars(obs=5) nowd contents='Proc Report Top'; column make model type drivetrain msrp; run; ods proclabel 'Three'; title '3) Title'; proc tabulate data=sashelp.class contents='Proc Tabulate Top'; class age sex; var height; table age all, sex*height*mean / contents='Table Stmt'; run; ods proclabel 'Four'; title '4) Title'; proc freq data=sashelp.prdsale; tables country*division / nocum nopercent contents='Proc Freq Top'; run; ods proclabel 'Five'; title '5) Title'; ** proc means does not support CONTENTS=; proc means data=sashelp.heart n mean min max; var ageatdeath cholesterol; class chol_status; run; ods _all_ close;
... View more