![]() | ![]() | ![]() | ![]() | ![]() |
This example shows an HTML-formatted table that contains the data from a SAS data set named cars. The Data Set Formatter created the HTML table.
Insert the following statement for the first SAS TITLE statement:
title1 '<font face=arial size=6 color=blue>
<b>Monthly Vehicle Sales Report</b></font><br>';
This specifies the font, size, color, weight, and text of the title.
Next, insert a valid HTML tag in a second SAS TITLE statement to include an animated inline image. (The following image was produced using SAS/SPECTRAVIEW software.)
title2 '<CENTER> <IMG SRC=sviewcar.gif></CENTER>';
The previous statement identifies the image location and centers the image.
Last, insert the following macro that calls the Data Set Formatter to create the HTML-formatted page:
%ds2htm(data=cars,
var=region vtype sales,
sum=sales,
encode=n,
proploc=sasuser.htmlgen.sview.slist,
bgtype=image,
bg=coolback.gif,
htmlfile=sview.html,
ttag=NO FORMATTING);
Specify the data set in DATA=, the variables in VAR=, and the sum variables in SUM=.
You can also specify the following arguments:
ENCODE=N, which tells the Data Set Formatter not to encode the angle brackets in the SAS TITLE statements so that the Web browser can act on them as an HTML-formatting instruction. This enables the Web browser to render the titles with the specified attributes.
PROPLOC=SASUSER.HTMLGEN.SVIEW.SLIST, which tells the Data Set Formatter to use the specified custom property list.
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.
HTMLFILE=SVIEW.HTML, which specifies the name of the HTML file.
TTAG=NO FORMATTING, which tells the Data Set Formatter not to assign HTML tags to the SAS title lines.
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.
title1 '<font face=arial size=6 color=blue><b> Monthly Vehicle Sales Report</b></font><br>';
title2 '<CENTER><IMG SRC=htmlgen.sviewcars.gif></CENTER>';
%ds2htm(data=cars,
var=region vtype sales,
sum=sales,
encode=n,
proploc=sasuser.htmlgen.sview.slist,
bgtype=image,
bg=htmlgen.coolback.gif,
htmlfile=htmlgen.sview.html,
ttag=NO FORMATTING);
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-05 03:02:52 |
| Date Created: | 2005-07-08 09:51:08 |
| Product Family | Product | Host | SAS Release | |
| Starting | Ending | |||
| SAS System | SAS/IntrNet | All | n/a | n/a |





