- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to write some tables to a RTF file, and some to an Excel sheet. After setting up the destinations I have code like the following. However, the title "Excel output 1" is appearing in the RTF output. How do I suppress this?
ods excel select none; title "RTF output 1"; proc etc; run; ods rtf select none; ods excel select all; title "Excel output 1"; proc etc; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
use ods rtf close or ods excel close to stop the destination export.
use TITLE without arguments to cancel all existing titles when not needed any more.
- Cheers -
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS Title and Footnote statements are not impacted by the ODS SELECT statements. ODS SELECT (and ODS EXCLUDE) control the output objects that are written to the the various destinations. Output objects are like the Extreme Obs table from PROC UNIVARIATE or the VARIABLES object from PROC CONTENTS. The output object is what is controlled/produced by the procedure. TITLES and FOOTNOTES are global in nature and apply to all the output being created by in a job step. If you have both ODS EXCEL and ODS RTF open at the same time, then the TITLE will get written to all the open destinations.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
Your understanding is correct. ODS RTF and ODS EXCEL do not allow "appending" after the original file is closed the first time. ODS only will write over the original file name if you try to append -- the only destination that allows appending is ODS HTML. I would either use a Macro program to control what is getting written to each destination like this or I would write all the output to an ODS DOCUMENT store and then replay the objects as I chose to the different destinations. Here's a paper https://support.sas.com/resources/papers/sgf09/318-2009.pdf that describes the ODS DOCUMENT approach. Look on page 17 for a more advanced use of the REPLAY statement to replay objects to differing destinations.
Here's an example of one possible macro program approach:
Since I used STARTPAGE=NO the second title for ODS RTF would not go on the same page with the first TITLE. That's why I used ODS TEXT= to place some text before the 2nd table.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for this. But it seems very messy for what is a simple requirement. I'll experiment with suppressing all titles and just using ODS Text to output my titles (and format them manually in Word).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can format the text from ODS RTF TEXT= using a STYLE template change. That method is shown in this paper on pages 11 and 12: https://support.sas.com/resources/papers/proceedings10/033-2010.pdf .
Cynthia