Problem Note 8044: The TEXT= option in the ODS PRINTER/RTF statement is always left justified
TEXT= is an option which became available in preproduction status in SAS® 8.2 in the ODS statements to add text between procedures. Since only one set of titles and footnotes are written out to a file when the STARTPAGE option is set to NO, OFF, or NEVER, this option is extremely useful for describing table information. By default, the text is left justified in the PRINTER (PCL, PDF, PS) and RTF files.
The code on the Full Code tab shows how to control this text with inline style commands or PROC TEMPLATE.
Operating System and Release Information
| SAS System | Base SAS | Microsoft Windows 95/98 | 8.2 TS2M0 | |
| Microsoft Windows NT Workstation | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows XP Professional | 8.2 TS2M0 | 9 TS M0 |
| Windows Millennium Edition (Me) | 8.2 TS2M0 | |
| Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows 2000 Professional | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows 2000 Server | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | 9 TS M0 |
| OpenVMS VAX | 8.2 TS2M0 | |
| 64-bit Enabled Solaris | 8.2 TS2M0 | |
| Solaris | 8.2 TS2M0 | |
| IRIX | 8.2 TS2M0 | |
| OS/2 | 8.2 TS2M0 | |
| z/OS | 8.2 TS2M0 | 9 TS M0 |
| Linux | 8.2 TS2M0 | 9 TS M0 |
| CMS | 8.2 TS2M0 | |
| ABI+ for Intel Architecture | 8.2 TS2M0 | |
| 64-bit Enabled HP-UX | 8.2 TS2M0 | |
| OpenVMS Alpha | 8.2 TS2M0 | 9 TS M0 |
| 64-bit Enabled AIX | 8.2 TS2M0 | 9 TS M0 |
| Tru64 UNIX | 8.2 TS2M0 | 9 TS M0 |
| AIX | 8.2 TS2M0 | 9 TS M0 |
| HP-UX | 8.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The sample code shows how to use PROC TEMPLATE and inline style commands to center the text written by the ODS
TEXT= option.
/* In the PRINTER destination, which can create PCL, PDF and PostScript
(PS) files, the use of inline style commands will allow control over
justification. The following inline style command will center the
text placed on the ODS PDF TEXT= statement in SAS 8.2 and later: */
ods escapechar='^';
ods pdf file='file.pdf' startpage=no;
proc print data=sashelp.class(obs=1);
run;
ods pdf text="^S={just=c} This is my interim title";
proc print data=sashelp.class(obs=1);
run;
ods pdf close;
/*In SAS 9.1, where the TEXT= option is production status, an OUTPUTWIDTH
specification is necessary for similar logic to work in the RTF destination. */
ods rtf text="^S={outputwidth=100% just=c} My Text";
/* The following PROC TEMPLATE code will also provide formatting control for
the PRINTER destinations starting in SAS 8.2 and higher and the RTF destination
in SAS 9.1 and later: */
proc template;
define style mystyle ;
parent=styles.printer;
style UserText from Note / just=c;
end;
run;
/* Prior to SAS 9.1, the TEXT= option does not adhere to any inline style
specifications or PROC TEMPLATE instructions for justification in RTF,
so the raw RTF code below is necessary to force center justification
in the RTF destination in SAS 8.2: */
ods rtf file="file.rtf" startpage=no;
proc print data=sashelp.class (obs=1);
run;
ods rtf
text="{\trowd\trqc\cellx11520\intbl\qc{My Text\cell}{\row}\pard}";
proc print data=sashelp.class (obs=1);
run;
ods rtf close;
The TEXT= option in the ODS PRINTER/RTF statement is always left justified.
| Type: | Problem Note |
| Priority: | medium |
| Topic: | SAS Reference ==> ODS (Output Delivery System)
|
| Date Modified: | 2009-02-05 09:47:45 |
| Date Created: | 2002-07-17 17:28:57 |