| Dictionary of ODS Language Statements |
| Valid in: | anywhere |
| Category: | ODS: Output Control |
| Tip: | The ODS TEXT= statement is sent only to output destinations that are open. Therefore, it must be specified after an ODS destination statement. |
| Syntax | |
| Required Arguments | |
| Examples | |
| Example 1: Adding Text to Multiple Destinations | |
Syntax |
| ODS TEXT= 'text-string' |
specifies the text to insert into your output. This text is sent to all open supported output destinations.
| Restriction: | The ODS TEXT= statement does not support the OUTPUT destination or the LISTING destination. All other ODS destinations are supported. |
| Requirement: | You must enclose 'text-string' in parentheses. |
| Tip: | The UserText style element controls text specified with the TEXT= statement. |
| Examples |
|
ODS HTML statement | |||||||
|
ODS PDF statement | |||||||
|
ODS RTF statement | |||||||
|
ODS TEXT= statement | |||||||
|
PROC TEMPLATE:
|
|
PROC PRINT |
The following example uses a single ODS TEXT= statement to add text to PDF, HTML, and traditional RTF output. PROC TEMPLATE modifies the UserText style element which controls the font style, font color, and other attributes of the text that the ODS TEXT= statement adds.
options obs=10;
| |
proc template;
define style mystyle;
parent=styles.default;
style usertext from usertext /
foreground=red;
end;
run; |
| |
ods html file="text.html" style=mystyle; ods pdf file="text.pdf" startpage=never notoc style=mystyle; ods rtf file="text_trad.rtf" style=mystyle; |
| |
ods text="My Text 1"; ods text="My Text 2"; |
| |
title "January Orders "; footnote " For All Employees9"; |
| |
proc print data=exprev; run; |
| |
ods text="My Text 3"; |
| |
ods _all_ close; title; footnote; |
| |
proc template; delete mystyle; run; |
HTML Output with Text Added
![[HTML Output with Text Added]](images/textstmnthtml.gif)
PDF Output with Text Added
![[PDF Output with Text Added]](images/textstmntpdf.gif)
Traditional RTF Output with Text Added
![[Traditional RTF Output with Text Added]](images/textstmntrtftrad.gif)
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.