Files Produced by the HTML Destination
Overview
The HTML destination can produce four types of files: body, contents, frame, and page
files. You create these files with options in the ODS HTML statement (see “ODS HTML
Statement ” on page 304 for details).
The Body File
The body file contains HTML output that is generated from the output objects that your
SAS job creates. The style and the table template that the job uses determine the
appearance and content of the tables and the cells within them.
Typically, when you route an output object that does not contain graphics to the HTML
destination, ODS places the results within <TABLE> tags, generating them as one or
more HTML tables.
Graphics output is produced according to the SAS code that generates it. Instead of using
<TABLE> tags, the body file contains an <IMG> (image) tag that references the graphic.
When you view the body file in a browser, you cannot tell that the graphic is not part of
the body file because the <IMG> tag displays it in the browser.
Note: Very few procedures produce output objects that are neither tabular nor graphics.
In these cases, the output is not tagged as an HTML table.
Titles and footnotes in the body file are generated as HTML tables of their own near the
top and bottom of each page of HTML output.
Note: For graphics output, titles and footnotes are, by default, part of the graphics file.
You can use the NOGTITLE and NOGFOOTNOTE options to place them in the
body file instead. See the discussion of GTITLE and GFOOTNOTE in “ODS HTML
Statement ” on page 304 for more information.
All <TABLE> tags and all <IMG> tags are potential targets for links or references.For
more information, see “How ODS Constructs Links and References” on page 1091.
Therefore, ODS must provide an <A> tag with a NAME attribute close to each <TABLE>
and <IMG> tag for links and references to point to. The NAME attribute on the anchor tag
becomes the final part of any reference or link to the table. ODS inserts anchor tags in its
HTML output as follows:
ODS places an anchor tag near the top of each page, before all tables on the page
(including the table that holds the titles) and before all images. This anchor is the
target for links to the first table (excluding any titles) or to the first image on the
page.
Note: Each procedure or DATA step starts a new page. In addition, ODS produces a
new page of output whenever the SAS program explicitly asks for a new page.
For example, if you use the page dimension in PROC TABULATE, then you
create a page for each value of the variable that defines the pages. In this context,
the word "page" has nothing to do with the PAGESIZE= setting in your SAS
session.
ODS places an anchor tag slightly before each <TABLE> tag, provided that the table
contains results (not titles or footnotes) and that it is not the first table or image on
the page.
1094 Appendix 3 ODS and the HTML Destination

Get SAS 9.4 Output Delivery System, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.