Sample 37077: How to selectively add content to one of the formatted ODS destinations
You can selectively add content to one of the formatted ODS destinations such as RTF, PDF, or HTML by specifying the inline formatting function {DEST}. This function takes the ODS destination which the content will apply to as the argument. This function allows you to nest other functions as well. The DEST function is new for SAS® 9.2.
Please see the code in the Full Code tab for an example.
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.
The text generated from the ODS TEXT= statements appear with different foreground colors depending on the destination. The {DEST} function specifies the destination to send the text to. The destination is nested along with the {STYLE} function that applies the foregound color for the various destinations.
ods escapechar="^";
ods html file="c:\temp.html";
ods rtf file="c:\temp.rtf" bodytitle;
ods pdf file="c:\temp.pdf";
ods text="^{dest [html] ^{style [foreground=green] Text only displays in the HTML output}}";
ods text="^{dest [rtf] ^{style [foreground=orange] Text only displays in the RTF output}}";
ods text="^{dest [pdf] ^{style [foreground=blue] Text only displays in the PDF output}}";
proc print data=sashelp.class;
run;
ods pdf close;
ods rtf close;
ods html close;
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.
You can selectively add content to one of the formatted ODS destinations such as RTF, PDF, or HTML by specifying the inline formatting function {DEST}.
Date Modified: | 2010-04-16 10:23:22 |
Date Created: | 2009-09-03 10:37:32 |
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Solaris for x64 | 9.2 TS1M0 | |