This example uses the HTML Tabulate Formatter, one of the HTML Formatting Tools, to capture results generated by PROC TABULATE. The Tabulate Formatter captures results in a method similar to the Output Formatter. You indicate the start and end of capturing.
To begin capturing the output, insert the Tabulate Formatter CAPTURE=ON statement. This captures all PROC TABULATE output until a CAPTURE=OFF statement is encountered.
Next, insert a SAS TITLE statement that contains embedded HTML tags. These tags change the justification and appearance of the text that will display in the HTML-formatted pages.
Then, insert the PROC TABULATE code. This procedure generates the output, which is captured by the Tabulate Formatter and displayed on the HTML page.
After the SAS code, add the following code to the end of the file:
%tab2htm(capture=off, runmode=b, openmode=replace, htmlfile=final.html, brtitle=Tabulate Formatter Example, center=Y, tsize=+3, clcolor=blue, rlcolor=blue, twidth=90, bgtype=image, bg=marble1.jpg, encode=N);
This turns capturing off and specifies the following arguments:
HTMLFILE=FINAL.HTML, which specifies the name of the HTML file.
BRTITLE=TABULATE FORMATTER EXAMPLE, which specifies the text that appears in the Web browser window title bar.
CENTER=Y, which centers all PROC TABULATE results on the HTML-formatted page.
TSIZE=+3, which increases the size of the font used for the title.
CLCOLOR=BLUE, which specifies blue column labels.
RLCOLOR=BLUE, which specifies blue row labels.
TWIDTH=90, which formats the table width as 90% of the HTML page.
BGTYPE=IMAGE, which indicates that you want to use an image as the background type. Specify the name of the image in the BG= argument.
ENCODE=N, which tells the Tabulate Formatter not to encode the angle brackets in any statements so that the Web browser can act on them as an HTML-formatting instruction.
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.
options linesize=96 pagesize=54 nocenter nodate nonumber;
title '<IMG ALIGN=CENTER SRC=globeanm.gif> World Wide Product Sales Report';
%tab2htm(capture=on,
runmode=b);
proc tabulate data=sashelp.prdsal2 formchar='82838485868788898a8b8c'x;
table state,
(actual predict ) * (sum*f=dollar14.2 mean*f=dollar14.2);
var actual predict;
class state;
keylabel sum="Total";
keylabel mean="Average";
run;
%tab2htm(capture=off,
runmode=b,
openmode=replace,
htmlfile=final.html,
brtitle=Tabulate Formatter Example,
center=Y,
tsize=+3,
clcolor=blue,
rlcolor=blue,
twidth=90,
bgtype=image,
bg=marble1.jpg,
encode=N);
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.
A sample output file is available here.
Type: | Sample |
Topic: | Software Components ==> HTML Formatting Tools |
Date Modified: | 2006-12-07 13:24:48 |
Date Created: | 2005-07-08 09:57:30 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/IntrNet | All | n/a | n/a |