SAS procedures and the DATA step generate at least two nodes in the table of contents generated by ODS PDF, the CONTENTS= option on the ODS HTML statement, and the CONTENTS TOC_DATA options on the ODS RTF statement. The first node's text can be controlled by the ODS PROCLABEL statement .
The second node can be controlled in some instances by options in the PROC statements or substatements in a PROC statement. The DESCRIPTION= option on the action statement of SAS/GRAPH procedures can be used to change the text entries of the second nodes. See Sample 25248 for an example.
The CONTENTS= option in the PRINT, REPORT, and TABULATE PROC statements can be used to change or eliminate the text of the second node produced by these procedures. See SAS Note 23428 for sample code. In addition, PROC TEMPLATE can be used to make changes to this text for procedures that use a TABLE template.
While changes to the text of the second node are helpful, it is often the case that only one set of nodes is required or needed in the table of contents. For full control of the table of contents nodes, use ODS DOCUMENT to store the results of the PROC or DATA steps, then use PROC DOCUMENT to replay the output with the desired nodes and labels.
The sample code in the Full Code tab generates two PDF files showing a change in the table of contents from:
The PRINT Procedure Data Set SASHELP.CLASS The GPLOT Procedure Plot of Age * Name
To:
First Node Second Node
For additional information regarding the ODS DOCUMENT destination and PROC DOCUMENT, see ODS DOCUMENT resources.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
/* Uncomment this code to delete GSEG members
in the WORK library if they exist */
/*proc greplay nofs igout=work.gseg; */
/* delete _all_; */
/*run; */
/*quit; */
ods listing close;
ods pdf file="before.pdf" ;
ods document name=test(write);
proc print data=sashelp.class;
run;
proc gplot data=sashelp.class;
plot age*name;
run;
quit;
ods document close;
ods pdf close;
ods listing;
proc document name=test;
list / levels=all; run;
/*-- Move output from under folders --*/
move \Print#1\Print#1 to ^; run;
move \Gplot#1\Gplot#1 to ^; run;
/*-- Verify document leaf nodes moved out from under the folders --*/
list / levels=all details; run;
setlabel \Work.test\Print#2 "First node"; run;
setlabel \Work.test\Gplot#2 "Second node"; run;
/*-- Delete folders --*/
delete \Print#1, \Gplot#1; run;
/*-- Verify folders were deleted --*/
list / levels=all; run;
/*-- Close Listing Destination --*/
ods listing close;
/*-- Replay output (Print and GPlot to PDF) --*/
ods pdf file="after.pdf";
replay;
run;
ods pdf close;
quit;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Date Modified: | 2021-03-05 15:50:11 |
Date Created: | 2009-10-26 12:22:12 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | Base SAS | z/OS | 9.1 TS1M3 SP4 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |||
Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |||
Windows Vista | 9.1 TS1M3 SP4 | |||
64-bit Enabled AIX | 9.1 TS1M3 SP4 | |||
64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |||
64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |||
HP-UX IPF | 9.1 TS1M3 SP4 | |||
Linux | 9.1 TS1M3 SP4 | |||
Linux on Itanium | 9.1 TS1M3 SP4 | |||
OpenVMS Alpha | 9.1 TS1M3 SP4 | |||
Solaris for x64 | 9.1 TS1M3 SP4 | |||
Tru64 UNIX | 9.1 TS1M3 SP4 |