SAS® 9.2 introduced new style elements BORDER<location>COLOR and BORDER<location>WIDTH, where location=BOTTOM, TOP, RIGHT, or LEFT. These style elements enable you to customize the borders inside the tables.
The sample code on the Full Code tab demonstrates how to customize the borders in the header section of ODS PDF and ODS RTF output using PROC REPORT. The first PROC REPORT step customizes horizontal borders. The second PROC REPORT step customizes vertical borders.
Keep in mind that any style attributes that you specify in the PROC REPORT statement are inherited if you do not override them in another PROC REPORT statement. This means that unless a particular border is specified in the COLUMN or DEFINE statement, its attributes come from the PROC REPORT statement or the underlying style.
A sample illustrating table borders can be found in SAS Sample 46022.
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.
Each cell has a left and a right border. To control vertical borders, the right border of the first cell and the left border of the second cell need to be changed.
ods escapechar="^";
options missing='' nodate;
ods pdf file='test.pdf' notoc;
ods rtf file='test.rtf';
title "Horizontal Border Lines";
proc report nowd data=sashelp.class
style(report)=[rules=none frame=void]
style(header)=[background=white borderbottomwidth=2 borderbottomcolor=magenta];
col ('^S={borderbottomcolor=blue}Overall'
('^S={borderbottomcolor=orange} '
'^S={borderbottomcolor=cyan} ' name)
('^S={borderbottomcolor=DarkViolet}This is spanned'
('^S={borderbottomcolor=green} A' age sex)
('^S={borderbottomcolor=yellow} B' weight height)));
run;
/* Each cell has a left and a right border. To control vertical borders, the right border
of the first cell and the left border of the second cell need to be changed.*/
title "Vertical Border Lines";
proc report nowd data=sashelp.class
style(report)=[rules=none frame=void]
style(header)=[background=white borderleftwidth=2 borderrightwidth=2 bordertopcolor=white
borderbottomcolor=white borderleftcolor=magenta borderrightcolor=magenta ];
col ('^S={borderleftcolor=blue borderrightcolor=blue}Overall'
('^S={borderleftcolor=orange borderrightcolor=DarkViolet} '
'^S={borderleftcolor=cyan borderrightcolor=DarkGreen} ' name)
('^S={borderleftcolor=DarkViolet borderrightcolor=DarkViolet }This is spanned'
('^S={borderleftcolor=DarkGreen borderrightcolor=yellow} A' age sex)
('^S={borderleftcolor=yellow borderrightcolor=yellow} B' weight height)));
run;
ods _all_ 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 |
Date Modified: | 2012-03-29 14:25:02 |
Date Created: | 2012-03-14 16:11:22 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | Base SAS | 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 | |||
Windows Vista for x64 | 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 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |||
Microsoft® Windows® for x64 | 9.2 TS1M0 | |||
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |||
z/OS | 9.2 TS1M0 |