Sample 30935: How can I center all of the output created by PROC PRINT in ODS?
PROC PRINT output routed to the non-LISTING destinations (HTML, PDF & RTF) can be controlled by PROC TEMPLATE or by the STYLE(<location>) option on the PROC PRINT statement. This ODS RTF sample code shows how to center all output, the headers, the OBS column, as well as the data. Similar logic applies to ODS HTML and ODS PDF.
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.
proc template;
define style styles.center;
parent=styles.printer;
/* Control PROC PRINT's headers */
style header from header /
cellwidth=1in
just=c;
/* Control PROC PRINT's data values */
style data from data /
just=c;
/* Control the OBS column */
style rowheader from header /
cellwidth=1in
just=c;
end;
run;
options orientation=portrait ;
ods rtf file="template.rtf" style=styles.center;
proc print data=sashelp.class ;
title "using PROC TEMPLATE to control cellwidth and justification in PROC PRINT";
run;
ods rtf close;
ods rtf file="proc.rtf" ;
proc print data=sashelp.class style(data header obs)={cellwidth=1in just=c};
title "using PROC PRINT's syntax to control cellwidth and justification";
run;
ods rtf 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.
| Type: | Sample |
| Topic: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> HTML Third Party ==> Output ==> PDF Third Party ==> Output ==> RTF SAS Reference ==> Procedures ==> PRINT
|
| Date Modified: | 2008-01-16 12:08:46 |
| Date Created: | 2008-01-15 13:29:34 |
Operating System and Release Information
| SAS System | Base SAS | z/OS | 8.2 TS2M0 | |
| OpenVMS VAX | 8.2 TS2M0 | |
| OS/2 | 8.2 TS2M0 | |
| Microsoft Windows 95/98 | 8.2 TS2M0 | |
| Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | |
| Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | |
| Microsoft Windows 2000 Server | 8.2 TS2M0 | |
| Microsoft Windows 2000 Professional | 8.2 TS2M0 | |
| Microsoft Windows NT Workstation | 8.2 TS2M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 8.2 TS2M0 | |
| Microsoft Windows Server 2003 Enterprise Edition | 8.2 TS2M0 | |
| Microsoft Windows Server 2003 Standard Edition | 8.2 TS2M0 | |
| Microsoft Windows XP Professional | 8.2 TS2M0 | |
| Windows Millennium Edition (Me) | 8.2 TS2M0 | |
| 64-bit Enabled AIX | 8.2 TS2M0 | |
| 64-bit Enabled HP-UX | 8.2 TS2M0 | |
| 64-bit Enabled Solaris | 8.2 TS2M0 | |
| ABI+ for Intel Architecture | 8.2 TS2M0 | |
| AIX | 8.2 TS2M0 | |
| HP-UX | 8.2 TS2M0 | |
| IRIX | 8.2 TS2M0 | |
| Linux | 8.2 TS2M0 | |
| OpenVMS Alpha | 8.2 TS2M0 | |
| Solaris | 8.2 TS2M0 | |
| Tru64 UNIX | 8.2 TS2M0 | |