Sample 25402: Demonstrates custom ODS styles with a hyperlink
This sample uses PROC TABULATE with the ODS HTML statement to demonstrate the use of the STYLE option as well as adding an image and a hyperlink to the output.
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.
This sample uses PROC TABULATE with the ODS HTML statement to demonstrate the use of the STYLE option as well as adding an image and a hyperlink to the output.
This sample is from the SAS Sample Library. For additional information refer to "SAS Output Delivery System: User's Guide".
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: ODSTAB11 */
/* TITLE: Demonstrates Custom ODS Styles with links */
/* PRODUCT: BASE */
/* SYSTEM: ALL */
/* KEYS: ODS HTML BODY= */
/* PROCS: TABULATE */
/* DATA: */
/* SUPPORT: UPDATE: */
/* REF: */
/* MISC: */
/* */
/****************************************************************/
/* Close the listing destination */
ods listing close;
/* Open the HTML destination */
ods html body="odstab11.html";
/* Create a sample data set */
data tabulate;
input dept acct qtr mon expense @@;
cards;
1 1345 1 1 12980 1 1674 1 3 13135 3 4138 1 1 29930
1 1345 1 1 9475 1 1674 1 3 21672 3 4138 1 2 22530
1 1345 1 1 15633 1 1674 1 3 3847 3 4138 1 2 16446
1 1345 1 2 14009 1 1674 1 3 2808 3 4138 1 2 27135
1 1345 1 2 10226 1 1674 1 3 4633 3 4138 1 3 24399
1 1345 1 2 16872 2 2134 1 1 34520 3 4138 1 3 17811
1 1345 1 2 17800 2 2134 1 1 25199 3 4138 1 3 29388
1 1345 1 2 12994 2 2134 1 1 41578 3 4138 1 3 16592
1 1345 1 2 21440 2 2134 1 2 26560 3 4138 1 3 12112
1 1345 1 3 35300 2 2134 1 2 19388 3 4138 1 3 19984
1 1345 1 3 25769 2 2134 1 2 31990 3 4279 1 1 9984
1 1345 1 3 42518 2 2134 1 3 24399 3 4279 1 1 7288
1 1578 1 1 8000 2 2134 1 3 17811 3 4279 1 1 12025
1 1578 1 1 5840 2 2134 1 3 29388 3 4279 1 2 14209
1 1578 1 1 9636 2 2403 1 1 25464 3 4279 1 2 10372
1 1578 1 2 7900 2 2403 1 1 18588 3 4279 1 2 17113
1 1578 1 2 5767 2 2403 1 1 30670 3 4279 1 3 13500
1 1578 1 2 9515 2 2403 1 2 15494 3 4279 1 3 9855
1 1578 1 3 4500 2 2403 1 2 11310 3 4279 1 3 16260
1 1578 1 3 3285 2 2403 1 2 18661 3 4290 1 1 10948
1 1578 1 3 5420 2 2403 1 2 1482 3 4290 1 1 7992
1 1674 1 1 11950 2 2403 1 2 1081 3 4290 1 1 13186
1 1674 1 1 8723 2 2403 1 2 1783 3 4290 1 2 14539
1 1674 1 1 14392 2 2403 1 3 10009 3 4290 1 2 10613
1 1674 1 2 13534 2 2403 1 3 7306 3 4290 1 2 17511
1 1674 1 2 9879 2 2403 1 3 12054 3 4290 1 3 11459
1 1674 1 2 16300 3 4138 1 1 24850 3 4290 1 3 8365
1 1674 1 3 17994 3 4138 1 1 18140 3 4290 1 3 13802
;
run;
proc format;
value qtrfmt 1 = 'FIRST QUARTER'
2 = 'SECOND QUARTER'
3 = 'THIRD QUARTER'
4 = 'FOURTH QUARTER';
value monfmt 1 = 'January'
2 = 'February'
3 = 'March'
4 = 'April'
5 = 'May'
6 = 'June'
7 = 'July'
8 = 'August'
9 = 'September'
10 = 'October'
11 = 'November'
12 = 'December';
value dept 1 = 'Accounting'
2 = 'Human Resources'
3 = 'Systems';
run;
proc tabulate format=dollar11.2;
/* Give headings a purple foreground. */
class mon qtr acct dept / style={foreground=purple};
classlev mon qtr acct dept / style={foreground=purple
font_style=italic};
var expense / style={foreground=purple};
format qtr qtrfmt.;
format mon monfmt.;
format dept dept.;
label expense = "Expenses";
/* Left-justify and italicize row total heading */
/* and link it to another Web page. */
table dept=' ' all=
{label='All Depts'
}
/* Highlight row totals with a red background. */
*{style={background=red}},
/* Italicize column total heading. */
(mon=' ' all={label="First Quarter"
style={foreground=purple}}
/* Highlight column totals with a red background. */
*{style={background=red}})
*expense*sum=' ' /
/* Make table background green */
style={background=green}
/* Display a graphic image in the box above the row */
/* headings. */
/* Before submitting this sample code, modify the */
/* value for SRC= below to specify the image you */
/* want to use. */
box={style={PREHTML="<img src=""magnify.gif""
alt='Place your image here'>"}};
run;
/* Close the HTML destination and open */
/* the listing destination */
ods html close;
ods listing;
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.
This sample uses PROC TABULATE with the ODS HTML statement to demonstrate the use of the STYLE option as well as adding an image and a hyperlink to the output.
| Type: | Sample |
| Topic: | SAS Reference ==> ODS (Output Delivery System) SAS Reference ==> Procedures ==> TABULATE Third Party ==> Output ==> HTML
|
| Date Modified: | 2011-02-17 10:59:30 |
| Date Created: | 2005-05-23 13:51:25 |
Operating System and Release Information
| SAS System | Base SAS | All | 9.1 TS1M3 | n/a |