Previous Page | Next Page

ODS and the HTML Destination

Files Produced by the HTML Destination

The HTML destination can produce four kinds of files: body, contents, frame, and page files. You create these files with options in the ODS HTML statement (see ODS HTML Statement 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.  [cautionend]

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 for more information.  [cautionend]

All <TABLE> tags and all <IMG> tags are potential targets for links or references (see How ODS Constructs Links and References). 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:

The following figure illustrates the placement of anchor tags from a SAS job that executes two procedures. The first procedure creates two HTML tables of results on a single page. The page also includes an HTML table for the title and one for the footnote. Solid arrows indicate which <A> tag ODS uses as a target for each table. The second procedure creates a GIF file. The titles for this procedure are part of the GIF file (the default behavior). Again, the solid arrow indicates which anchor tag ODS uses as a target when it creates a link to the image. The dashed arrow points to the file that the <IMG> tag references.

Placement of <A> (anchor) Tags in HTML Output

[Placement of <A> (anchor) Tags in HTML Output]

For a view of this same file through a browser, see Browser View of HTML Frame File.

The Contents File

The contents file contains a link to the body file for each HTML table that ODS creates from procedure or DATA step results. The targets for these links are the values of the NAME attributes on the anchor tags that are in the body file (see The Body File). For example, an anchor tag that links to the second HTML table of results in Placement of <A> (anchor) Tags in HTML Output looks like this:

<A href="pop-body.htm#IDX1">

In this anchor tag,

You can view the contents file directly in the browser, or, if you make a frame file, you can see the contents file as part of the frame file (see The Frame File).


The Page File

The page file contains a link to the body file for each page of HTML output that ODS creates from procedure or DATA step results. The targets for these links are the values of the NAME attributes on the anchor tags that are in the body file (see The Body File). For example, an anchor tag that links to the second page of results in Placement of <A> (anchor) Tags in HTML Output looks like this:

<A href="pop-body.htm#IDX2">

In this anchor tag,

You can view the page file directly in the browser, or, if you make a frame file, you can see the page file as part of the frame file (see The Frame File).


The Frame File

The frame file provides a simultaneous view of the body file and the contents file, the page file, or both. The following figure illustrates how a frame that references both the contents and page files looks (in part) to an ASCII editor. The SRC attribute identifies a file to display in the browser. ODS constructs the value for the SRC attribute the same way that it constructs the value for an HREF attribute in a page or contents file (see Schematic of an HTML Frame File).

Schematic of an HTML Frame File

[Schematic of an HTML Frame File]

Browser View of HTML Frame File shows the same frame file viewed from a browser.

Browser View of HTML Frame File

[Browser View of HTML Frame File]

Previous Page | Next Page | Top of Page