Date: Tue, 21 Jun 2005 15:37:25 -0700
Reply-To: WCheng@ISISPH.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Wei Cheng <WCheng@ISISPH.COM>
Subject: Re: Table of contents using ODS RTF
In-Reply-To: <200506211459.j5LExbYu024641@listserv.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"
John,
You can use the contents option in the PROC REPORT statement to modify the
second level entry. Try this:
ods rtf file='toc test.rtf' contents ;
title 'Report A';
ods proclabel 'Report A';
proc report data=sashelp.class nowindows contents = "My Report A";
columns name age sex height weight;
define sex /width=6 right;
run;
title 'Report B: Weight';
ods proclabel 'Report B: Weight';
proc report data=sashelp.class nowindows contents = "My Report B";
columns age weight=mean weight=std weight=n;;
define age /group;
define mean /analysis mean 'Mean' format=8.1;
define std /analysis std 'Std' format=8.1;
define n /analysis n 'N' format=8.0;
run;
title 'Report c: Height';
ods proclabel 'Report c: Height';
proc report data=sashelp.class nowindows contents = "My Report C";
columns age height=mean height=std height=n;;
define age /group;
define mean /analysis mean 'Mean' format=8.1;
define std /analysis std 'Std' format=8.1;
define n /analysis n 'N' format=8.0;
run;
ods rtf close;
HIH,
Wei
John Hendrickx <John_Hendrickx@YAHOO.COM>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
06/21/2005 07:59 AM
Please respond to
John Hendrickx <John_Hendrickx@YAHOO.COM>
To
SAS-L@LISTSERV.UGA.EDU
cc
Subject
Table of contents using ODS RTF
A method for creating a table of contents in Word documents generated with
ODS RTF is described at
http://support.sas.com/rnd/base/topics/odsrtf/rtf901.html. You have to add
the option "CONTENTS" to the "ODS RTF" statement. Once your rtf document
is
created, you can open it in WORD, right-click near the top of the document
and select "update fields".
This creates a table of contents, but not one that's of any use. Any
titles
you specify in your program are ignored in the TOC. There's a first level
entry labeled "Report" for all tables, and a second level entry labeled
"Detailed and/or summarized report".
I've found I can replace the first level entry by something meaningful
using
ODS PROCLABEL. But that still leaves the second level entry: does anyone
know how to modify it or omit it altogether?
Advance thanks for any help. Sample code follows to clarify what I mean.
I'm
just curious whether it's possible to get this system to work, I know
there
are better alternatives for generating a TOC.
-------------------------------------------------------------------------
ods rtf file='toc test.rtf' contents ;
title 'Report A';
ods proclabel 'Report A';
proc report data=sashelp.class nowindows;
columns name age sex height weight;
define sex /width=6 right;
run;
title 'Report B: Weight';
ods proclabel 'Report B: Weight';
proc report data=sashelp.class nowindows;
columns age weight=mean weight=std weight=n;;
define age /group;
define mean /analysis mean 'Mean' format=8.1;
define std /analysis std 'Std' format=8.1;
define n /analysis n 'N' format=8.0;
run;
title 'Report c: Height';
ods proclabel 'Report c: Height';
proc report data=sashelp.class nowindows;
columns age height=mean height=std height=n;;
define age /group;
define mean /analysis mean 'Mean' format=8.1;
define std /analysis std 'Std' format=8.1;
define n /analysis n 'N' format=8.0;
run;
ods rtf close;
-------------------------------------------------------------------------
ForwardSourceID:NT0007D7B2