ODS HTML Statement

Opens, manages, or closes the HTML destination, which produces HTML 4.0 output that contains embedded style sheets.
Valid in: Anywhere
Category: ODS: Third-Party Formatted
Restriction: When you open the destination, a style sheet is written and linked to the body file. Therefore, you cannot make style sheet changes from within your SAS program. For example, after the destination is open, changing the value of the STYLE= option has no effect. You can make style changes in either of the following ways:
  • Close the destination, edit or create a new style sheet, and submit the program again specifying the new or modified style sheet.
  • Edit the body file, changing the style sheet URL to the desired style sheet.
Interaction: By default, when you execute a procedure that uses the FORMCHAR system option (for example, PROC PLOT or PROC CHART), ODS formats the output in SAS Monospace font. If you are creating output that will be viewed in an operating environment where SAS software is not installed, this output will not display correctly. This is because without SAS, the SAS Monospace font is not recognized. To make your document display correctly, include the following statement before your SAS program:
OPTIONS FORMCHAR="|----|+|---+=|-/\<>*"; 
z/OS specifics: If you use graphics that are created with either the ACTXIMG or JAVAIMG device drivers in the z/OS operating environment, then specify either the GPATH= option or the PATH= option in the ODS HTML statement.
Note: The ODS HTML statement supports Scalable Vector Graphics. Scalable Vector Graphics (SVG) is an XML language for describing two-dimensional vector graphics. For information about scalable vector graphics, see Using Scalable Vector Graphics in SAS/GRAPH: Reference.

Syntax

ODS HTML <(<ID=> identifier)> < action> ;

Summary of Optional Arguments

Send output directly to a Web server instead of writing it to a file
Open multiple instances of the same destination at the same time
Specify that no ending markup language source code be added to the output file.
Specify that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Insert into the metadata of a file, the text string that you specify as the text to appear in the browser window title bar.
Specify a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Specify a unique base name for the anchor tag that identifies each output object in the current body file
Specify which applet to use to view ODS HTML output
Specify attributes to write between the tags that generate dynamic graphics output
Specify text to use as the first part of all links and references that ODS creates in output files
Open a markup family destination and specify the file that contains the primary output that is created by the ODS statement
Specify the character set to be generated in the META declaration for the HTML output
Close the destination and the file that is associated with it
Open the HTML destination and specify the file that contains relevant style information
Create a file path that can be used by the GOPTIONS devices
Open the HTML destination and specify the file that contains a table of contents for the output
Specify a cascading style sheet to apply to your output
Specify a device for the output destination
Override the encoding for input or output processing (transcodes) of external files
Specify an event and the value for event variables that is associated with the event
Exclude output objects from the destination
Specify the file that integrates the table of contents, the page contents, and the body file
Control the location where footnotes are printed in the graphics output
Specify the location for all graphics output that is generated while the destination is open
Control the location where titles are printed in the graphics output
Specify HTML tags to place between the < HEAD> and < /HEAD> tags in all the files that the destination writes to
Specify the image resolution for graphical output
Specify HTML code to use as the <META> tag between the <HEAD> and </HEAD> tags in all the HTML files that the destination writes to
Create a new body file at the specified starting point
Specify tagset-specific suboptions and a named value
Specify that the output from the destination be added to an ODS package
Open the HTML destination and specify the file that contains a description of each page of the body file, and contains links to the body file
Write the specified parameters between the tags that generate dynamic graphics output
Specify the location of an aggregate storage location or a SAS catalog for all markup files
Specify an alternative character or string to separate lines in the output files
Select output objects for the destination
Write to the SAS log the current selection or exclusion list for the destination
Specify a style definition to use in writing output files
Open the HTML destination and place style information for output into an external file, or read style sheet information from an existing file
Insert text into your document
Specify a translation table to use when transcoding a file for output

Without Arguments

If you use the ODS HTML statement without an action or options, then it opens the HTML destination and creates HTML output.

Actions

The following actions are available for the ODS HTML statement.

CLOSE
closes the destination and any files that are associated with it. For Printer destinations, you cannot print the file until you close the destination.
Tip:When an ODS destination is closed, ODS does not send output to that destination. Closing an unneeded destination conserves system resources.
EXCLUDE exclusion(s)| ALL | NONE
excludes one or more output objects from the destination.
Default:NONE
Restriction:A destination must be open for this action to take effect.
SELECT selection(s) | ALL | NONE
selects output objects for the specified destination.
Default:ALL
Restriction:A destination must be open for this action to take effect.
SHOW
writes the current selection list or exclusion list for the destination to the SAS log.
Restriction:The destination must be open for this action to take effect.
Tip:If the selection or exclusion list is the default list (SELECT ALL), then SHOW also writes the entire selection or exclusion list. For information about selection and exclusion lists, see Selection and Exclusion Lists.

Optional Arguments

ANCHOR= 'anchor-name'
specifies a unique base name for the anchor tag that identifies each output object in the current body file.
Each output object has an anchor tag for the contents, page, and frame files to reference. The links and references, which are automatically created by ODS, point to the name of an anchor. Therefore, each anchor name in a file must be unique.
anchor-name
is the base name for the anchor tag that identifies each output object in the current body file.
ODS creates unique anchor names by incrementing the name that you specify. For example, if you specify ANCHOR= 'TABULATE', then ODS names the first anchor tabulate. The second anchor is named tabulate1; the third is named tabulate2, and so on.
Restriction:Each anchor name in a file must be unique.
Requirement:You must enclose anchor-name in quotation marks.
Interaction:If you open a file to append to it, be sure to specify a new anchor name to prevent writing the same anchors to the file again. ODS does not recognize anchors that are already in a file when it opens the file.
Tips:You can change anchor names as often as you want by specifying the ANCHOR= option in a markup family statement anywhere in your program. After you have specified an anchor name, it remains in effect until you specify a new one.

Specifying new anchor names at various points in your program is useful when you want other Web pages to link to specific parts of your markup language output. Because you can control where the anchor name changes, you know in advance what the anchor name will be at those points.

ARCHIVE='string'
specifies which applet to use to view the ODS HTML output. The ARCHIVE= option is valid only for the GOPTIONS java device.
The string must be one that the browser can interpret. For example, if the archive file is local to the computer that you are running SAS on, you can use the FILE protocol to identify the file. If you want to point to an archive file that is on a Web server, use the HTTP protocol.
Default:If you do not specify ARCHIVE= and you are using the JAVA device driver, ODS uses the value of the SAS system option APPLETOC=. There is no default if you are using the ACTIVEX device driver.
Requirements:You must enclose string in quotation marks.

The ARCHIVE attribute is a feature of Java 1.1. Therefore, if you are using the Java device driver, your browser must support this version of Java. Both Internet Explorer 4.01 and Netscape 4.05 support Java 1.1.

Interaction:Use ARCHIVE= in conjunction with SAS/GRAPH procedures and the DEVICE=JAVA or DEVICE=ACTIVEX option in the GOPTIONS statement.
Tips:Typically, this option should not be used, because the SAS server automatically determines the correct SAS/GRAPH applets to view the ODS HTML output. However, if you have renamed the JAR files, or have other applets with which to view the ODS HTML output, this option enables you to access these applets.

Use the CODEBASE= option to specify the file path. It is recommended that you do not put a file path in your ARCHIVE= option.

The value of APPLETOC= points to the location of the Java archive files that ship with the SAS system. To find out what the value of this option is, you can either look in the Options window in the Files folder under Environment Control, or you can submit the following procedure step:

proc options option=appletloc;
run;

ATTRIBUTES= (attribute-pair-1 ... attribute-pair-n)
writes the specified attributes between the tags that generate dynamic graphics output.
attribute-pair
specifies the name and value of each attribute. attribute-pair has the following form:
'attribute-name'= 'attribute-value'
attribute-name
is the name of the attribute.
attribute-value
is the value of the attribute.
Requirement:You must enclose attribute-name and attribute-value in quotation marks.
Interaction:Use the ATTRIBUTES= option in conjunction with SAS/GRAPH procedures and with the DEVICE=JAVA, JAVAMETA, or ACTIVEX options in the GOPTIONS statement.
See:SAS/GRAPH: Reference for valid attributes for the Graph Applet, the Map Applet, the Contour Applet, and the MetaView Applet.
BASE= 'base-text'
specifies the text to use as the first part of all links and references that ODS creates in the output files.
base-text
is the text that ODS uses as the first part of all links and references that ODS creates in the file.
Consider this specification:
BASE= 'http://www.your-company.com/local-url/'
In this case, ODS creates links that begin with the string http://www.your-company.com/local-url/. The appropriate anchor-name completes the link.
Requirement:You must enclose base-text in quotation marks.
BODY= 'file-specification' (suboption(s))
opens a markup family destination and specifies the file that contains the primary output that is created by the ODS statement. These files remain open until you do one of the following:
  • close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
  • open the same destination with a second markup family statement. This closes the first file and opens the second file.
file-specification
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
external-file
is the name of an external file to write to.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
Restriction:The BODY=fileref option cannot be used in conjunction with the NEWFILE= option.
See:For more information, see FILENAME Statement in SAS Statements: Reference.
entry.markup
specifies an entry in a SAS catalog to write to.
Interaction:If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option.
(suboption(s))
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. Suboptions can be the following:
(DYNAMIC)
enables you to send output directly to a Web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information, see CONTENTTYPE= in PROC TEMPLATE.
Default:If you do not specify DYNAMIC, then ODS sets the value of HTMLCONTENTTYPE= for writing to a file.
Restriction:If you specify the DYNAMIC suboption with one of the following options in the ODS HTML statement, then you must specify it for all of these options in that statement.
  • BODY=
  • CONTENTS=
  • PAGE=
  • FRAME=
  • STYLESHEET=
  • TAGSET=
Requirements:You must enclose DYNAMIC in parentheses.

You must specify DYNAMIC next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

(NO_BOTTOM_MATTER)
specifies that no ending markup language source code be added to the output file.
Alias:NOBOT
Requirements:You must enclose NO_BOTTOM_MATTER in parentheses.

You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

Tip: If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification BODY= option in any markup language statement.
See: The NO_TOP_MATTER suboption
(NO_TOP_MATTER)
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias:NOTOP
Requirements:You must enclose NO_TOP_MATTER in parentheses.

You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

See: The NO_BOTTOM_MATTER suboption and the ANCHOR= option
(TITLE='title-text')
inserts into the metadata of a file the text string that you specify as the text to appear in the browser window title bar.
title-text
is the text in the metadata of a file that indicates the title.
Requirements:You must enclose TITLE= in parentheses.

You must enclose title-text in quotation marks.

Tip:If you are creating a Web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar.
(URL= 'Uniform-Resource-Locator' )
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirements:You must enclose URL= 'Uniform-Resource-Locator' in parentheses.

You must enclose Uniform-Resource-Locator in quotation marks.

You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

Tips:This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location.

You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file.

Alias:FILE=
Interaction:Using the BODY= option in an ODS markup family statement that refers to an open ODS markup destination forces ODS to close the destination and all associated files, and then to open a new instance of the destination. For more information see Opening and Closing the MARKUP Destination .
Note:For some values of TAGSET=, this output will be an HTML file, for other TAGSET= values, the output will be an XML file, and so on.
CHARSET= character-set
specifies the character set to be generated in the META declaration for the HTML output.
See:For more information, see CHARSET= Option in SAS National Language Support (NLS): Reference Guide.
CODE= 'file-specification' <(suboption(s))>
opens a markup family destination and specifies the file that contains relevant style information, such as XSL (Extensible Stylesheet Language). These files remain open until you do one of the following:
  • close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
  • open the same destination with a second markup family statement. This closes the first file and opens the second file.
file-specification
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
external-file
is the name of an external file to write to.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See:Fore more information, see FILENAME Statement in SAS Statements: Reference.
entry.markup
specifies an entry in a SAS catalog to write to.
Interaction:If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option.
suboption(s)
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. Suboptions can be the following:
(DYNAMIC)
enables you to send output directly to a Web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information, see CONTENTTYPE= in PROC TEMPLATE.
Default:If you do not specify DYNAMIC, then ODS sets the value of HTMLCONTENTTYPE= for writing to a file.
Restriction:If you specify the DYNAMIC suboption with one of the following options in the ODS HTML statement, then you must specify it for all of these options in that statement.
  • BODY=
  • CONTENTS=
  • PAGE=
  • FRAME=
  • STYLESHEET=
  • TAGSET=
Requirements:You must enclose DYNAMIC in parentheses.

You must specify DYNAMIC next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

(NO_BOTTOM_MATTER)
specifies that no ending markup language source code be added to the output file.
Alias:NOBOT
Requirements:You must enclose NO_BOTTOM_MATTER in parentheses.

You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

Tip: If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification BODY= option in any markup language statement.
See: The NO_TOP_MATTER suboption
(NO_TOP_MATTER)
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias:NOTOP
Requirements:You must enclose NO_TOP_MATTER in parentheses.

You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

See: The NO_BOTTOM_MATTER suboption and the ANCHOR= option
(TITLE='title-text')
inserts into the metadata of a file the text string that you specify as the text to appear in the browser window title bar.
title-text
is the text in the metadata of a file that indicates the title.
Requirements:You must enclose TITLE= in parentheses.

You must enclose title-text in quotation marks.

Tip:If you are creating a Web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar.
(URL= 'Uniform-Resource-Locator' )
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirements:You must enclose URL= 'Uniform-Resource-Locator' in parentheses.

You must enclose Uniform-Resource-Locator in quotation marks.

You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

Tips:This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location.

You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file.

CODEBASE='string'
specifies the location of the executable Java applet or the ActiveX control file. string is specified as a pathname or as a URL. The CODEBASE file path option has two definitions, depending on the GOPTIONS device used.
When you generate Web presentations with the JAVA and ActiveX device drivers, SAS generates HTML pages that automatically look for the JAVA archive files or the ActiveX control file in the default installation location.
For the ActiveX device:
If you use the ActiveX device driver with ODS to generate output containing an ActiveX control, then specify the CODEBASE= option in the ODS statement. The value of the CODEBASE= option should include the location and the version of the EXE file.
Tip:You do not need to specify the CODEBASE= option with the DEVICE=ACTIVEX option unless the users that view your output do not have the ActiveX control installed on their machine. When users that do not have the control installed view your output, they are prompted to download the control.
See:SAS/GRAPH: Reference for information about specifying the location of control and applet files using the CODEBASE= and ARCHIVE= options.
For the Java device:
If you use the Java device driver with ODS to generate output containing a SAS/GRAPH applet, specify the path to the JAR file with the CODEBASE= option in the ODS statement.
When you specify DEVICE=JAVA, the users that view your output must have access to the appropriate Java applet. By default, SAS sets the value of CODEBASE= to refer to the executable file for the applet that is automatically installed with SAS. The default location of the SAS Java archive files is specified by the APPLETLOC= system option. You do not need to specify the CODEBASE= option if both of the following conditions are true.
  • The default location is accessible by users who will be viewing your Web presentation.
  • The SAS Java archive is installed at that location.
Tip:Specify only the directory of the JAR file. The CODEBASE= location can be specified as a pathname or as a URL
See:SAS/GRAPH: Reference for information about specifying the location of control and applet files using the CODEBASE= and ARCHIVE= options.
CONTENTS= 'file-specification' <(suboption(s))>
opens a markup family destination and specifies the file that contains a table of contents for the output. These files remain open until you do one of the following:
  • close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
  • open the same destination with a second markup family statement. This closes the first file and opens the second file.
file-specification
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
external-file
is the name of an external file to write to.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See:For more information, see FILENAME Statement in SAS Statements: Reference.
entry.markup
specifies an entry in a SAS catalog to write to.
Interaction:If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option.
suboption(s)
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. Suboptions can be the following:
(DYNAMIC)
enables you to send output directly to a Web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information, see CONTENTTYPE= in PROC TEMPLATE.
Default:If you do not specify DYNAMIC, then ODS sets the value of HTMLCONTENTTYPE= for writing to a file.
Restriction:If you specify the DYNAMIC suboption with one of the following options in the ODS HTML statement, then you must specify it for all of these options in that statement.
  • BODY=
  • CONTENTS=
  • PAGE=
  • FRAME=
  • STYLESHEET=
  • TAGSET=
Requirements:You must enclose DYNAMIC in parentheses.

You must specify DYNAMIC next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

(NO_BOTTOM_MATTER)
specifies that no ending markup language source code be added to the output file.
Alias:NOBOT
Requirements:You must enclose NO_BOTTOM_MATTER in parentheses.

You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

Tip: If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification BODY= option in any markup language statement.
See: The NO_TOP_MATTER suboption
(NO_TOP_MATTER)
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias:NOTOP
Requirements:You must enclose NO_TOP_MATTER in parentheses.

You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

See: The NO_BOTTOM_MATTER suboption and the ANCHOR= option
(TITLE='title-text')
inserts into the metadata of a file the text string that you specify as the text to appear in the browser window title bar.
title-text
is the text in the metadata of a file that indicates the title.
Requirements:You must enclose TITLE= in parentheses.

You must enclose title-text in quotation marks.

Tip:If you are creating a Web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar.
(URL= 'Uniform-Resource-Locator' )
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirements:You must enclose URL= 'Uniform-Resource-Locator' in parentheses.

You must enclose Uniform-Resource-Locator in quotation marks.

You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

Tips:This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location.

You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file.

CSSSTYLE= 'file-specification'<(media-type-1<…media-type-10>)>
specifies a cascading style sheet to apply to your output.
file-specification
specifies a file, fileref, or URL that contains CSS code..
file-specification is one of the following:
"external-file"
is the name of the external file.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See:For more information, see FILENAME Statement in SAS Statements: Reference.
"URL"
is a URL to an external file.
Requirement:You must enclose external-file in quotation marks.
(media-type-1<.. media-type-10>)
specifies one or more media blocks that corresponds to the type of media that your output will be rendered on. CSS uses media type blocks to specify how a document is to be presented on different media: on the screen, on paper, with a speech synthesizer, with a braille device, and so on.
The media block is added to your output in addition to the CSS code that is not contained in any media blocks. By using the media-type suboption, in addition to the general CSS code, you can import the section of a CSS file intended only for a specific media type.
Default:If no media-type is specified in your ODS statement, but you do have media types specified in your CSS file, then ODS uses the Screen media type.
Range:You can specify up to ten different media types.
Requirements:You must enclose media-type in parentheses.

You must specify media-type next to the file-specification specified by the CSSSTYLE= option.

Tip:If you specify multiple media types, all of the style information in all of the media types is applied to your output. However, if there is duplicate style information in different media blocks, then the styles from the last media block are used.
Restriction:The CSSSTYLE= option does not affect SAS/GRAPH output.
Requirement:CSS files must be written in the same type of CSS produced by the ODS HTML statement. Only class names are supported, with no IDs and no context-based selectors. To view the CSS code that ODS creates, you can do one of the following:
  • Specify the STYLESHEET= option.
  • View the source of an HTML file and look at the code between the <STYLE> </STYLE> tags at the top of the file.
For an example of a valid ODS CSS file, see Applying a CSS File to ODS Output.
Interaction:If both the STYLE= option and the CSSSTYLE= option are specified on an ODS statement, the option specified last is the option that is used.
DEVICE= device-driver
specifies the name of a device driver. ODS automatically selects an optimal default device for each open output destination.
The following table lists the default devices for the most common ODS output destinations. These default devices are used when graphics are created using SAS/GRAPH or ODS Graphics. For a complete list of supported devices and file types, see Supported File Types for Output Destinations.
Default Devices for ODS Output Destinations
Output Destination
Default Device
HTML
PNG
LISTING
PNG
Measured RTF
PNG
RTF
PNG
PCL
Scalable Vector Graphics (SVG)
PDF
Scalable Vector Graphics (SVG)
POSTSCRIPT
PNG
PRINTER
Host Specific Default Printer
Markup Tagsets
All markup family tagsets have the default value built in.
Restriction:When you specify a device in an ODS destination statement, do not specify the ACTIVEX, ACTXIMG, JAVA, or JAVAIMG devices.
Tip:Specifying a device on the ODS DEVICE= option takes precedence over the SAS global option and the graphics option.
See:DEVICE= System Option in SAS System Options: Reference. For information about selecting device drivers, see Using Graphics Devices in SAS/GRAPH: Reference.
ENCODING= local-character-set-encoding
overrides the encoding for input or output processing (transcodes) of external files.
See:For information about the ENCODING= option, see ENCODING System Option: UNIX, Windows, and z/OS in SAS National Language Support (NLS): Reference Guide.
EVENT=event-name (FILE= | FINISH | LABEL= | NAME= | START | STYLE= |TARGET= | TEXT= | URL= )
specifies an event and the value for event variables that are associated with the event.
(FILE= BODY | CODE | CONTENTS | DATA | FRAME | PAGES | STYLESHEET);
triggers one of the known types of output files that correspond to the BODY=, CODE=, CONTENTS=, FRAME=, PAGES=, and STYLESHEET= options.
(FINISH)
triggers the finish section of an event.
See:For information about events, see Understanding Events.
(LABEL='variable-value')
specifies the value for the LABEL event variable.
Requirement:variable-value must be enclosed in quotation marks.
See:For information about the LABEL event variable, see Event Variables.
(NAME='variable-value')
specifies the value for the NAME event variable.
Requirement:variable-value must be enclosed in quotation marks.
See:For information about the NAME event variable, see Event Variables.
(START)
triggers the start section of an event.
See:For information about events, see Understanding Events.
(STYLE=style-element)
specifies a style element.
See:For information about style elements, see Style Attributes Overview.
(TARGET='variable-value')
specifies the value for the TARGET event variable.
Requirement:variable-value must be enclosed in quotation marks.
See:For information about the TARGET event variable, see Event Variables.
(TEXT='variable-value')
specifies the value for the TEXT event variable.
Requirement:variable-value must be enclosed in quotation marks.
See:For information about the TEXT event variable, see Event Variables.
(URL='variable-value')
specifies the value for the URL event variable.
Requirement:variable-value must be enclosed in quotation marks.
See:For information about the URL event variable, see Event Variables.
Default:(FILE='BODY')
Requirement:The EVENT= option's suboptions must be enclosed in parentheses.
FRAME= 'file-specification' <(suboption(s))>
opens a markup family destination and, for HTML output, specifies the file that integrates the table of contents, the page contents, and the body file. If you open the frame file, then you see a table of contents, a table of pages, or both, as well as the body file. For XLM output, FRAME= specifies the file that contains the DTD. These files remain open until you do one of the following:
  • close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
  • open the same destination with a second markup family statement. This closes the first file and opens the second file.
file-specification
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
external-file
is the name of an external file to write to.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See:For more information, see FILENAME Statement in SAS Statements: Reference.
entry.markup
specifies an entry in a SAS catalog to write to.
Interaction:If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option.
suboption(s)
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. Suboptions can be the following:
(DYNAMIC)
enables you to send output directly to a Web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information, see CONTENTTYPE= in PROC TEMPLATE.
Default:If you do not specify DYNAMIC, then ODS sets the value of HTMLCONTENTTYPE= for writing to a file.
Restriction:If you specify the DYNAMIC suboption with one of the following options in the ODS HTML statement, then you must specify it for all of these options in that statement.
  • BODY=
  • CONTENTS=
  • PAGE=
  • FRAME=
  • STYLESHEET=
  • TAGSET=
Requirements:You must enclose DYNAMIC in parentheses.

You must specify DYNAMIC next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

(NO_BOTTOM_MATTER)
specifies that no ending markup language source code be added to the output file.
Alias:NOBOT
Requirements:You must enclose NO_BOTTOM_MATTER in parentheses.

You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

Tip: If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification BODY= option in any markup language statement.
See: The NO_TOP_MATTER suboption
(NO_TOP_MATTER)
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias:NOTOP
Requirements:You must enclose NO_TOP_MATTER in parentheses.

You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

See: The NO_BOTTOM_MATTER suboption and the ANCHOR= option
(TITLE='title-text')
inserts into the metadata of a file the text string that you specify as the text to appear in the browser window title bar.
title-text
is the text in the metadata of a file that indicates the title.
Requirements:You must enclose TITLE= in parentheses.

You must enclose title-text in quotation marks.

Tip:If you are creating a Web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar.
(URL= 'Uniform-Resource-Locator' )
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirements:You must enclose URL= 'Uniform-Resource-Locator' in parentheses.

You must enclose Uniform-Resource-Locator in quotation marks.

You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

Tips:This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location.

You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file.

Restriction:If you specify the FRAME= option, then you must also specify the CONTENTS= option, the PAGE= option, or both.
GFOOTNOTE | NOGFOOTNOTE
controls the location where footnotes are printed in the graphics output.
GFOOTNOTE
prints footnotes that are created by SAS/GRAPH, the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure. The footnotes appear inside the graph borders.
NOGFOOTNOTE
prints footnotes that are created by ODS, which appears outside the graph borders.
Default:GFOOTNOTE
Restrictions:Footnotes that are displayed by a markup language statement support all SAS/GRAPH FOOTNOTE statement options. The font must be valid for the browser. Options that ODS cannot handle, such as text angle specifications, are ignored. For details about the SAS/GRAPH FOOTNOTE statement, see FOOTNOTE Statement in SAS/GRAPH: Reference.

This option applies only to SAS programs that produce one or more device-based graphics, or graphics created by the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure.

GPATH= 'aggregate-file-storage-specification' | fileref | libref.catalog (URL= 'Uniform-Resource-Locator' | NONE)
specifies the location for all graphics output that is generated while the destination is open. Use this option when you want to write graphics output files to a location different that specified by the PATH= option for markup files. If you specify an invalid filename, the ActiveX and Java devices send output to the default filename. Other devices create the file as a directory and write output to that directory using the default filename. For more information about how ODS names catalog entries and external files, see SAS/GRAPH: Reference.
'aggregate-file-storage-location'
specifies an aggregate storage location such as directory, folder, or partitioned data set.
Requirement:You must enclose aggregate-file-storage-location in quotation marks.
fileref
is a file reference that has been assigned to an aggregate storage location. Use the FILENAME statement to assign a fileref.
Interaction:If you specify a fileref in the GPATH= option, then ODS does not use information from the GPATH= option when it constructs links.
See:For information about the FILENAME statement, see FILENAME Statement in SAS Statements: Reference.
libref.catalog
specifies a SAS catalog to write to.
URL= 'Uniform-Resource-Locator' | NONE
specifies a URL for file-specification.
Uniform-Resource-Locator
is the URL that you specify. ODS uses this URL instead of the filename in all the links and references that it creates to the file.
Requirement:You must enclose Uniform-Resource-Locator in quotation marks.
NONE
specifies that no information from the GPATH= option appears in the links or references.
Tip:This option is useful for building output files that can be moved from one location to another. If the links from the contents and page files are constructed with a simple URL (one name), then they will resolve, as long as the contents, page, and body files are all in the same location.
Default:If you omit the GPATH= option, then ODS stores graphics in the location that is specified by the PATH= option. If you do not specify the PATH= option, then ODS stores the graphics in the current directory. For more information, see the PATH= option.
GTITLE | NOGTITLE
controls the location where titles are printed in the graphics output.
GTITLE
prints the title that is created by SAS/GRAPH, the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure. The title appears inside the graph borders.
NOGTITLE
prints the title that is created by ODS, which appears outside of the graph borders.
Default:GTITLE
Restrictions:Titles that are displayed by any markup language statement support most SAS/GRAPH TITLE statement options. The font must be valid for the browser. Options that ODS cannot handle, such as text angle specifications, are ignored. For details about the SAS/GRAPH TITLE statement, see TITLE statement.

This option applies only to SAS programs that produce one or more device-based graphics, or graphics created by the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure.

HEADTEXT= 'markup-document-head'
specifies markup tags to place between the < HEAD> and < /HEAD> tags in all the files that the destination writes to.
markup-document-head
specifies the markup tags to place between the < HEAD> and < /HEAD> tags.
Restriction:HEADTEXT= cannot exceed 256 characters.
Requirement:You must enclose markup-document-head in quotation marks.
Tips:ODS cannot parse the markup that you supply. It should be well-formed markup that is correct in the context of the <HEAD> and </HEAD> tags.

Use the HEADTEXT= option to define programs (such as JavaScript) that you can use later in the file.

(ID= identifier)
enables you to run multiple instances of the same destination at the same time. Each instance can have different options.
identifier
specifies another instance of the destination that is already open. identifier is numeric or a series of characters that begin with a letter or an underscore. Subsequent characters can include letters, underscores, and numeric characters.
Restriction:If identifier is numeric, it must be a positive integer.
Requirement:The ID= option must be specified immediately after the ODS MARKUP/TAGSET statement keywords.
Tip:You can omit the ID= option, and instead use a name or a number to identify the instance.
IMAGE_DPI=
specifies the image resolution for graphical output.
Default:96
METATEXT= 'metatext-for-document-head'
specifies HTML code to use as the <META> tag between the <HEAD> and </HEAD> tags of all the HTML files that the destination writes to.
'metatext-for-document-head'
specifies the HTML code that provides the browser with information about the document that it is loading. For example, this attribute could specify the content type and the character set to use.
Requirement:You must enclose metatext-for-document-head in quotation marks.
Default:If you do not specify METATEXT=, then ODS writes a simple <META> tag, which includes the content-type of the document and the character set to use, to all the HTML files that it creates.
Restriction:METATEXT= cannot exceed 256 characters.
Tip:ODS cannot parse the HTML code that you supply. It should be well-formed HTML code that is correct in the context of the <HEAD> tags. If you are using METATEXT= as it is intended, then your META tag should look like this:
<META your-metatext-is-here>
NEWFILE= starting-point
creates a new body file at the specified starting-point.
starting-point
is the location in the output where you want to create a new body file.
ODS automatically names new files by incrementing the name of the body file. In the following example, ODS names the first body file REPORT.XML. Additional body files are named REPORT1.XML, REPORT2.XML, and so on.
Example:
BODY= 'REPORT.XML'
starting-point is one of the following:
BYGROUP
starts a new file for the results of each BY group.
NONE
writes all output to the body file that is currently open.
OUTPUT
starts a new body file for each output object. For SAS/GRAPH this means that ODS creates a new file for each SAS/GRAPH output file that the program generates.
Alias:TABLE
PAGE
starts a new body file for each page of output. A page break occurs when a procedure explicitly starts a new page (not because the page size was exceeded) or when you start a new procedure.
PROC
starts a new body file each time you start a new procedure.
Default:NONE
Restriction:The NEWFILE= option cannot be used in conjunction with the BODY=fileref option.
Tips:If you end the filename with a number, then ODS begins incrementing with that number. In the following example, ODS names the first body file MAY5.XML. Additional body files are named MAY6.XML, MAY7.XML, and so on.

Example:

BODY= 'MAY5.XML'

OPTIONS ( DOC= | <suboption(s)> )
specifies tagset-specific suboptions and a named value.
(DOC= 'HELP' |'QUICK' | 'SETTINGS' | ‘CHANGELOG’)
provides information about the specified tagset.
HELP
provides generic help and information with a quick reference.
QUICK
describes the options available for this tagset.
SETTINGS
provides the current option settings.
CHANGELOG
lists a history of changes made to the tagset. This suboption is only supported on the RTF tagset.
Requirement:All values must be enclosed in quotation marks.
suboption(s)
specifies one or more suboptions that are valid for the specified tagset. Suboptions have the following format:
keyword='value'
Specify one of the following options when opening an ODS tagset statement, or at any time after the destination has been opened, to get information about suboptions for the tagset.
  • options(doc='help');
  • options(doc='quick');
  • options(doc='settings');
Requirement:suboption(s) must be enclosed in parentheses.
PACKAGE <package-name>
specifies that the output from the destination be added to a package.
package-name
specifies the name of a package that was created with the ODS PACKAGE statement. If no name is specified, then the output is added to the unnamed package that was opened last.
PAGE= 'file-specification' <(suboption(s))>
opens a markup family destination and specifies the file that contains a description of each page of the body file, and contains links to the body file. ODS produces a new page of output whenever a procedure requests a new page. These files remain open until you do one of the following:
  • close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
  • open the same destination with a second markup family statement. This closes the first file and opens the second file.
file-specification
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
external-file
is the name of an external file to write to.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See:For information about the FILENAME statement, see FILENAME Statement in SAS Statements: Reference.
entry.markup
specifies an entry in a SAS catalog to write to.
Interaction:If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option.
suboption(s)
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. Suboptions can be the following:
(DYNAMIC)
enables you to send output directly to a Web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information, see CONTENTTYPE= in PROC TEMPLATE.
Default:If you do not specify DYNAMIC, then ODS sets the value of HTMLCONTENTTYPE= for writing to a file.
Restriction:If you specify the DYNAMIC suboption with one of the following options in the ODS HTML statement, then you must specify it for all of these options in that statement.
  • BODY=
  • CONTENTS=
  • PAGE=
  • FRAME=
  • STYLESHEET=
  • TAGSET=
Requirements:You must enclose DYNAMIC in parentheses.

You must specify DYNAMIC next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

(NO_BOTTOM_MATTER)
specifies that no ending markup language source code be added to the output file.
Alias:NOBOT
Requirements:You must enclose NO_BOTTOM_MATTER in parentheses.

You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

Tip: If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification BODY= option in any markup language statement.
See: The NO_TOP_MATTER suboption
(NO_TOP_MATTER)
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias:NOTOP
Requirements:You must enclose NO_TOP_MATTER in parentheses.

You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

See: The NO_BOTTOM_MATTER suboption and the ANCHOR= option
(TITLE='title-text')
inserts into the metadata of a file the text string that you specify as the text to appear in the browser window title bar.
title-text
is the text in the metadata of a file that indicates the title.
Requirements:You must enclose TITLE= in parentheses.

You must enclose title-text in quotation marks.

Tip:If you are creating a Web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar.
(URL= 'Uniform-Resource-Locator' )
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirements:You must enclose URL= 'Uniform-Resource-Locator' in parentheses.

You must enclose Uniform-Resource-Locator in quotation marks.

You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

Tips:This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location.

You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file.

Interaction:The SAS system option PAGESIZE= has no effect on pages in HTML output except when you are creating batch output. For information about the PAGESIZE= option, see PAGESIZE= System Option in SAS System Options: Reference.
PARAMETERS= (parameter-pair-1 ... parameter-pair-n)
writes the specified parameters between the tags that generate dynamic graphics output.
parameter-pair
specifies the name and value of each parameter. parameter-pair has the following form:
'parameter-name'= 'parameter-value'
parameter-name
is the name of the parameter.
parameter-value
is the value of the parameter.
Requirement:You must enclose parameter-name and parameter-value in quotation marks.
Interaction:Use PARAMETERS= in conjunction with SAS/GRAPH procedures and the DEVICE=JAVA, JAVAMETA, or ACTIVEX options in the GOPTIONS statement.
See:SAS/GRAPH: Reference for valid parameters for the Graph Applet, Map Applet, Contour Applet, and the MetaView Applet.
PATH= 'aggregate-file-storage-specification' | fileref | libref.catalog (URL= 'Uniform-Resource-Locator' | NONE)
specifies the location of an aggregate storage location or a SAS catalog for all markup files. If the GPATH= option is not specified, all graphics output files are written to the “aggregate-file-storage-specification” or libref.
'aggregate-file-storage-location'
specifies an aggregate storage location such as directory, folder, or partitioned data set.
Requirement:You must enclose aggregate-file-storage-location in quotation marks.
fileref
is a file reference that has been assigned to an aggregate storage location. Use the FILENAME statement to assign a fileref.
Interaction:If you use a fileref in the PATH= option, then ODS does not use information from PATH= when it constructs links.
See:For information about the FILENAME statement, see FILENAME Statement in SAS Statements: Reference.
libref.catalog
specifies a SAS catalog to write to.
See:For information about the LIBNAME statement, see LIBNAME Statement in SAS Statements: Reference.
URL= 'Uniform-Resource-Locator' | NONE
specifies a URL for the file-specification.
Uniform-Resource-Locator
is the URL that you specify. ODS uses this URL instead of the filename in all the links and references that it creates to the file.
NONE
specifies that no information from the PATH= option appears in the links or references.
Tip:This option is useful for building output files that can be moved from one location to another. The links from the contents and page files must be constructed with a single-name URL, and the contents, page, and body files must be in the same location.
Interaction:If you use the BODY= or FILE= external file option in conjunction with the PATH= option, the external file specification should not include path information.
RECORD_SEPARATOR= 'alternative-separator' | NONE
specifies an alternative character or string that separates lines in the output files.
Different operating environments use different separator characters. If you do not specify a record separator, then the files are formatted for the environment where you run the SAS job. However, if you are generating files for viewing in a different operating environment that uses a different separator character, then you can specify a record separator that is appropriate for the target environment.
alternative-separator
represents one or more characters in hexadecimal or ASCII format. For example, the following option specifies a record separator for a carriage return character and a linefeed character for use with an ASCII file system:
RECORD_SEPARATOR= '0D0A'x
Operating Environment Information: In a mainframe environment, the following option specifies a record separator for a carriage return character and a linefeed character for use with an ASCII file system:
RECORD_SEPARATOR= '0D25'x
Requirement:You must enclose alternative-separator in quotation marks.
NONE
produces the markup language that is appropriate for the environment where you run the SAS job.
Windows Specifics: In a mainframe environment, by default, ODS produces a binary file that contains embedded record separator characters. This binary file is not restricted by the line-length restrictions on ASCII files. However, if you view the binary files in a text editor, then the lines run together. If you want to format the files so that you can read them with a text editor, then use RECORD_SEPARATOR= NONE. In this case, ODS writes one line of markup language at a time to the file. When you use a value of NONE, the logical record length of the file that you are writing to must be at least as long as the longest line that ODS produces. If the logical record length of the file is not long enough, then the markup language might wrap to another line at an inappropriate place.
Aliases:RECSEP=

RS=

STYLE= style-definition
specifies the style definition to use in writing the output files.
style-definition
describes how to display the presentation aspects (color, font face, font size, and so on) of your SAS output. A style definition determines the overall appearance of the documents that use it. Each style definition consists of style elements.
Interaction:The STYLE= option is not valid when you are creating XML output.
See:For a complete discussion of style definitions, see TEMPLATE Procedure: Creating a Style Template.
Default:If you do not specify a style definition, then ODS uses the file that is specified in the SAS registry subkey ODSthen selectDESTINATIONSthen selectMARKUP. By default, this value specifies Default.
Interaction:If you specify the STYLE= option on an ODS HTML4 statement and subsequently need PROC PRINT output to use new style definitions on another ODS HTML4 statement, close the first statement before specifying the second statement.
STYLESHEET= 'file-specification' <(suboption(s))>
opens a markup family destination and places the style information for markup output into an external file, or reads style sheet information from an existing file. These files remain open until you do one of the following:
  • close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
  • open the same destination with a second markup family statement. This closes the first file and opens the second file.
file-specification
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
external-file
is the name of an external file to write to.
Requirement:You must enclose external-file in quotation marks.
fileref
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See:For information about the FILENAME statement, see FILENAME Statement in SAS Statements: Reference.
entry.markup
specifies an entry in a SAS catalog to write to.
Interaction:If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option.
suboption(s)
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. Suboptions can be the following:
(DYNAMIC)
enables you to send output directly to a Web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information, see CONTENTTYPE= in PROC TEMPLATE.
Default:If you do not specify DYNAMIC, then ODS sets the value of HTMLCONTENTTYPE= for writing to a file.
Restriction:If you specify the DYNAMIC suboption with one of the following options in the ODS HTML statement, then you must specify it for all of these options in that statement.
  • BODY=
  • CONTENTS=
  • PAGE=
  • FRAME=
  • STYLESHEET=
  • TAGSET=
Requirements:You must enclose DYNAMIC in parentheses.

You must specify DYNAMIC next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

(NO_BOTTOM_MATTER)
specifies that no ending markup language source code be added to the output file.
Alias:NOBOT
Requirements:You must enclose NO_BOTTOM_MATTER in parentheses.

You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

Tip: If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification BODY= option in any markup language statement.
See: The NO_TOP_MATTER suboption
(NO_TOP_MATTER)
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias:NOTOP
Requirements:You must enclose NO_TOP_MATTER in parentheses.

You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

See: The NO_BOTTOM_MATTER suboption and the ANCHOR= option
(TITLE='title-text')
inserts into the metadata of a file the text string that you specify as the text to appear in the browser window title bar.
title-text
is the text in the metadata of a file that indicates the title.
Requirements:You must enclose TITLE= in parentheses.

You must enclose title-text in quotation marks.

Tip:If you are creating a Web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar.
(URL= 'Uniform-Resource-Locator' )
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirements:You must enclose URL= 'Uniform-Resource-Locator' in parentheses.

You must enclose Uniform-Resource-Locator in quotation marks.

You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

Tips:This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location.

You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file.

Note:By default, if you do not specifically send the information to a separate file, then the style sheet information is included in the specified HTML file.
TEXT=text-string
inserts text into your document by triggering the paragraph event and specifying a text string to be assigned to the VALUE event variable.
Default:By default the TEXT= option is used in a paragraph event.
Tip:You can specify a text-string for a specific event by using the TEXT= option with the EVENT= option by using the following syntax:
EVENT=event-name (TEXT=text-string)
See:For information about events and event variables, see TEMPLATE Procedure: Creating Markup Language Tagsets.
TRANTAB= 'translation-table'
specifies the translation table to use when transcoding a file for output.
See:For information about the TRANTAB= option, see TRANTAB= System Option in SAS National Language Support (NLS): Reference Guide.

Suboptions

The following suboptions can be used with these options: BODY= , CODE= , CONTENTS= , FRAME= , PAGE= , and STYLESHEET=.

(DYNAMIC)
enables you to send output directly to a Web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information, see CONTENTTYPE= in PROC TEMPLATE.
Default:If you do not specify DYNAMIC, then ODS sets the value of HTMLCONTENTTYPE= for writing to a file.
Restriction:If you specify the DYNAMIC suboption with one of the following options in the ODS HTML statement, then you must specify it for all of these options in that statement.
  • BODY=
  • CONTENTS=
  • PAGE=
  • FRAME=
  • STYLESHEET=
  • TAGSET=
Requirements:You must enclose DYNAMIC in parentheses.

You must specify DYNAMIC next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

(NO_BOTTOM_MATTER)
specifies that no ending markup language source code be added to the output file.
Alias:NOBOT
Requirements:You must enclose NO_BOTTOM_MATTER in parentheses.

You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

Tip: If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification BODY= option in any markup language statement.
See: The NO_TOP_MATTER suboption
(NO_TOP_MATTER)
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias:NOTOP
Requirements:You must enclose NO_TOP_MATTER in parentheses.

You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

If you append text to an external file, you must use a FILENAME statement with the appropriate option for the operating environment.

Interactions:The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file.

When you are opening a file that ODS has previously written to, use the ANCHOR= option to specify a new base name for the anchors. This step prevents duplicate anchors.

See: The NO_BOTTOM_MATTER suboption and the ANCHOR= option
(TITLE='title-text')
inserts into the metadata of a file the text string that you specify as the text to appear in the browser window title bar.
title-text
is the text in the metadata of a file that indicates the title.
Requirements:You must enclose TITLE= in parentheses.

You must enclose title-text in quotation marks.

Tip:If you are creating a Web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar.
(URL= 'Uniform-Resource-Locator' )
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirements:You must enclose URL= 'Uniform-Resource-Locator' in parentheses.

You must enclose Uniform-Resource-Locator in quotation marks.

You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option.

Tips:This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location.

You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file.

Details

The ODS HTML statement is part of the ODS markup family of statements. ODS statements in the markup family produce output that is formatted using one of many different markup languages, such as HTML (Hypertext Markup Language), XML (Extensible Markup Language), and LaTeX. You can specify a markup language that SAS supplies, or create one of your own and store it as a user-defined markup language.
Beginning with SAS 9.3, by default, in the Windowing environment with the Windows and UNIX operating systems, the LISTING destination is closed and the HTML destination is open. You do not have to submit an ODS HTML statement to generate HTML output, and you do not have to use the ODS HTML CLOSE statement to be able to view your output. However, to create LISTING output, you must either submit the ODS LISTING statement or enable the LISTING destination by other means. For more details, see Working with Output Defaults in SAS 9.3.
Another change with SAS 9.3 is that the default style for the HTML destination is now HTMLBlue.
The HTML destination now supports Scalable Vector Graphics (SVG). For information about scalable vector graphics, see Using Scalable Vector Graphics in SAS/GRAPH: Reference.

Examples

Example 1: Using the DOC Suboption to Get ODS HTML Information

Features:

ODS HTML statement action:: CLOSE

ODS HTML statement options:: OPTIONS (DOC=”HELP”)

Other features:

PROC PRINT

Details

The following example prints to the SAS log a list of OPTIONS suboptions and a description of each suboption that is available for the HTML tagset.

Program

ods html options (doc="help");
proc print data=Sashelp.Class;
run;

Program Description

Print information about the OPTIONS suboptions to the SAS log file.
ods html options (doc="help");
Print the data set Sashelp.Class.The PROC PRINT statement prints the Sashelp.Class data set.
proc print data=Sashelp.Class;
run;

Output

Specify the “DOC='HELP' suboption to print all of the OPTIONS suboptions and information about each of the suboptions to the SAS log.
Options Suboptions Available for HTML
Options Available for HTML

Example 2: Using the Option Suboption PAGEBREAK=

Features:

ODS HTML statement options:: OPTIONS (PAGEBREAK=”NO”)

Other features:

PROC PRINT

Details

The following example shows how to use the PAGEBREAK= suboption to control whether a page break is allowed or not. The default is to provide a page break after each print statement. In HTML, a page break is rendered by separating output with a horizontal rule. With PAGEBREAK="NO", the horizontal rule is not produced.

Program

ods html file="test.html" options(pagebreak='no');
options obs=2;
proc print data=Sashelp.Class;
run;
proc print data=Sashelp.Class;
run;

Program Description

Specify the PAGEBREAK=”NO” suboption. The two data sets will be rendered without a separating horizontal rule. The output will be printed to the test.html file.
ods html file="test.html" options(pagebreak='no');
Print only two observations of the data set.
options obs=2;
Print the data set Sashelp.Class.The PROC PRINT statement prints the Sashelp.Class data set.
proc print data=Sashelp.Class;
run;
Print the data set Sashelp.Class.Print the Sashelp.Class data set again. Because PAGEBREAK=”NO” is specified, there will not be a page break between the two data sets. By default, these two data sets would be written to two different pages.
proc print data=Sashelp.Class;
run;

Output

Specify the PAGEBREAK=”NO” suboption if you want fewer pages of output.
PAGEBREAK= Suboption Set to NO in HTML
Using PAGEBREAK= Suboption

Example 3: Creating a Separate Body File for Each Page of Output

Features:

ODS HTML statement action:: CLOSE

ODS HTML statement options::
BASE=
CONTENTS=
BODY=
FRAME=
NEWFILE=
PAGE=
Other features:

#BYVAL parameter in titles

NOBYLINE|BYLINE system option

OPTIONS statement

PROC FORMAT

PROC SORT

PROC REPORT

PROC TABULATE

TITLE statement

Data set: Grain_Production
Format: $CNTRY.

Details

The following example creates a separate HTML file for each page of procedure output, as well as a table of contents, a table of pages, and a frame file. The table of contents and table of pages appear and behave the same as those that would be created if all the output were in a single file. Because the output is in separate files, you cannot scroll from one page of output to the next. However, you can select individual HTML files to include in a report.

Program

proc sort data=grain_production;
   by year country type;
run;
ods html body='grain-body.htm'
     contents='grain-contents.htm'
        frame='grain-frame.htm'
         page='grain-page.htm'
   newfile=page;
options nobyline;
title 'Leading Grain-Producing Countries';
title2 'for #byval(year)';
proc report data=grain_production nowindows;
   by year;
   column country type kilotons;
   define country  / group width=14 format=$cntry.;
   define type     / group 'Type of Grain';
   define kilotons / format=comma12.;
   footnote 'Measurements are in metric tons.';
run;
options byline;
title2;
proc tabulate data=grain_production format=comma12.;
   class year country type;
   var kilotons;
   table year,
         country*type,
         kilotons*sum=' ' / box=_page_ misstext='No data';
   format country $cntry.;
   footnote 'Measurements are in metric tons.';
run;
ods html close;

Program Description

Sort the data set Grain_Production.PROC SORT sorts the data, first by values of the variable Year, then by values of the variable Country, and finally by values of the variable Type.
proc sort data=grain_production;
   by year country type;
run;
Create HTML output. The ODS HTML statement opens the HTML destination and creates HTML output. The FRAME=, CONTENTS=, and PAGE= options create a frame that includes a table of contents and a table of pages that link to the contents of the body file. The body file also appears in the frame. BASE= specifies a string to use as the first part of all links and references to the HTML files. Because no URL is specified for individual files, the final part of the link will match the filename. The string that the BASE= option specifies must be a valid path to your HTML files.
ods html body='grain-body.htm'
     contents='grain-contents.htm'
        frame='grain-frame.htm'
         page='grain-page.htm'
Specify that SAS create a new body file for each page of output.The NEWFILE=PAGE option opens and creates a new body file for each page of output.
   newfile=page;
Suppress the default BY line and specify a new value into the BY line. The NOBYLINE option suppresses the default BY line variable. The #BYVAL parameter specification inserts the current value of the BY variable Year into the title.
options nobyline;
title 'Leading Grain-Producing Countries';
title2 'for #byval(year)';
Produce a report.This PROC REPORT step produces a report on grain production. Each BY group produces a page of output, so ODS creates a new body file for each BY group. The NOWINDOWS option specifies that PROC REPORT runs without the REPORT window and sends its output to any open output destinations.
proc report data=grain_production nowindows;
   by year;
   column country type kilotons;
   define country  / group width=14 format=$cntry.;
   define type     / group 'Type of Grain';
   define kilotons / format=comma12.;
   footnote 'Measurements are in metric tons.';
run;
Restore the default BY line and clear the second TITLE statement.The BYLINE option restores the default BY line. The TITLE2 statement clears the second TITLE statement.
options byline;
title2;
Produce a report.The TABLE statement in this PROC TABULATE step has the variable Year specified. Therefore, PROC TABULATE explicitly produces one page of output for 1995 and one for 1996. ODS starts a new body file for each page.
proc tabulate data=grain_production format=comma12.;
   class year country type;
   var kilotons;
   table year,
         country*type,
         kilotons*sum=' ' / box=_page_ misstext='No data';
   format country $cntry.;
   footnote 'Measurements are in metric tons.';
run;
Close the HTML destination.The ODS HTML CLOSE statement closes the HTML destination and all the files that are associated with it. If you do not close the destination, then you will not be able to view the HTML file specified by the FRAME attribute until you close your SAS session.
ods html close;

HTML Output

This frame file shows the first body file. Links in the table of contents and the table of pages point to the other body files. The frame file is not rendered in the results viewer after running this example. To open it, locate the file in your SAS output location.
HTML Frame File
HTML Frame File

Links That Are Created in the HTML Output

These HREF= attributes from the links in the contents file point to the HTML tables that ODS creates from the PROC REPORT and PROC TABULATE steps.
href="grain-body.htm#IDX"
href="grain-body1.htm#IDX1"
href="grain-body2.htm#IDX2"
href="grain-body3.htm#IDX3"
Notice how these HREF attributes are constructed:
  • The value of the BODY= option, grain-body, provides the basis for the next part of the HREF. However, because the NEWFILE= option creates a new file for each output object, ODS increments this base value each time it creates a file. The resulting filenames become part of the HREF. They are Grain-Body.htm, Grain-Body1.htm, Grain-Body2.htm, and Grain-Body3.htm.
  • The value of the ANCHOR= option provides the basis for the last part of the HREF, which follows the pound sign (#). Because the ANCHOR= option is not used in this example, ODS uses the default value of IDX. With each use, ODS increments the value of the anchor.

Example 4: Appending to HTML Files

Features:
ODS HTML statement options::
ANCHOR=
BODY= with a fileref
BODY= using the NO_BOTTOM_MATTER suboption
BODY= using the NO_TOP_MATTER suboption
STYLE=
Other features:

FILENAME statement

PROC PRINT

PROC REPORT

DATA _NULL_ statement

Data set: Grain_Production
Format: $CNTRY.

Details

The following example creates HTML output from PROC PRINT and PROC REPORT. It also uses the DATA step to write customized HTML code to the file that contains the HTML output. The DATA step executes between procedure steps.

Program

options obs=10;
filename reports 'GrainReport.html';
ods html body=reports (no_bottom_matter)
         style=Banker;
proc print data=grain_production;
   var country type kilotons;
   format country $cntry. kilotons comma12.;
   where year=1996;
   title 'Leading Grain-Producing Countries';
   footnote 'Measurements are in metric tons.';
run;
ods html close;
filename reports '../ods/grain-reports-body.htm' mod;
filename reports 'GrainReport.html' mod;
data _null_;
   file reports;
   put "<h2>The preceding output is from PROC PRINT.";
   put "I am going to try a variety of procedures.";
   put "Let me know which procedure you prefer.";
   put "This report uses the Banker style.</h2>";
run;
ods html body=reports (no_top_matter no_bottom_matter)
         anchor='report';
proc report data=grain_production nowindows;
   where year=1996;
   column country type kilotons;
   define country / group width=14 format=$cntry.;
   define type / group 'Type of Grain';
   define kilotons / format=comma12.;
run;
ods html close;
data _null_;
   file reports;
   put "<h2>The preceding output is from PROC REPORT.";
   put "It does not repeat the name of the country on every line.";
   put "This report uses the default style.</h2>";
run;
ods html body=reports(no_top_matter)anchor='end';

Program Description

Set system options. This OBS option limits processing of observations in the data set to 10.
options obs=10;
Assign a fileref to the file GrainReport.html.The FILENAME statement assigns the fileref REPORTS to the file GrainReport.html that will contain the HTML output.
filename reports 'GrainReport.html';
Create HTML output and suppress the writing of the default HTML code that would be written at the end of the file.The ODS HTML statement opens the HTML destination and creates HTML output. The NO_BOTTOM_MATTER option suppresses the writing of the default HTML code that, by default, ODS writes at the end of a file.
ods html body=reports (no_bottom_matter)
Specify the style definition for formatting the HTML output.The STYLE= option specifies that the style Banker be used.
         style=Banker;
Create a report that contains only the data from 1996.Select and format the variables that you want to include, specify a title, and specify a footnote. This PROC PRINT step prints the observations in the data set Grain_Production that have a value of 1996 for the variable Year. The VAR statement selects Country, Type, and Kilotons as the variables that you want to be displayed in the output. The TITLE and FOOTNOTE statements specify the title and footnote.
proc print data=grain_production;
   var country type kilotons;
   format country $cntry. kilotons comma12.;
   where year=1996;
   title 'Leading Grain-Producing Countries';
   footnote 'Measurements are in metric tons.';
run;
Close the HTML destination.The ODS HTML CLOSE statement closes the HTML destination and all the files that are associated with it.
ods html close;
filename reports '../ods/grain-reports-body.htm' mod;
Assign the fileref REPORTS to the file 'GrainReport.html'.This FILENAME statement assigns a fileref to the file to be updated, GrainReport.html. The MOD option opens the file in Update mode. The MOD option might not be valid in all operating environments. See your operating environment documentation for more information.
filename reports 'GrainReport.html' mod;
Append text to the HTML file REPORTS.This DATA step writes to the file that is referenced by REPORTS. The PUT statements create an H2 header in the HTML file.
data _null_;
   file reports;
   put "<h2>The preceding output is from PROC PRINT.";
   put "I am going to try a variety of procedures.";
   put "Let me know which procedure you prefer.";
   put "This report uses the Banker style.</h2>";
run;
Create HTML output. This ODS HTML statement opens the HTML destination and creates HTML output. The NO_TOP_MATTER and the NO_BOTTOM_MATTER suboptions suppress the default HTML code that ODS writes to the top and the bottom of a file.
ods html body=reports (no_top_matter no_bottom_matter)
Specify the root name for the HTML anchor tags.The ANCHOR= option specifies report as the root name for the HTML anchor tags. When you use ODS to append to an HTML file that ODS created, you must specify a new anchor name each time you open the file from ODS so that you do not write the same anchors to the file again. (ODS cannot recognize anchors that are already in the file when it opens it, and by default it uses IDX as the base for anchor names).
         anchor='report';
Create a report that contains only the 1996 data.The PROC REPORT step prints the data set. ODS adds HTML output to the body file. The NOWINDOWS option specifies that PROC REPORT runs without the REPORT window and sends its output to the open output destination(s).
proc report data=grain_production nowindows;
   where year=1996;
   column country type kilotons;
   define country / group width=14 format=$cntry.;
   define type / group 'Type of Grain';
   define kilotons / format=comma12.;
run;
Close the HTML destination.The ODS HTML CLOSE statement closes the HTML destination and all the files that are associated with it.
ods html close;
Append text to the HTML file REPORTS. This DATA step writes to the file that is referenced by REPORTS. The PUT statements create an H2 header in the HTML file.
data _null_;
   file reports;
   put "<h2>The preceding output is from PROC REPORT.";
   put "It does not repeat the name of the country on every line.";
   put "This report uses the default style.</h2>";
run;
Create HTML output to write the bottom matter to the file, repress the printing of the top matter, and provide a new root name for the anchor tags.In order to write the bottom matter to the HTML file so that it contains valid HTML code, you must open the HTML destination one more time. NO_TOP_MATTER ensures that the top matter is not placed in the file again. ANCHOR= provides a new root name for the anchors in the bottom matter.
ods html body=reports(no_top_matter)anchor='end';

HTML Output

This output is created by appending HTML output to an existing HTML file.
HTML Output with Appended HTML
HTML Output with Appended HTML

Example 5: Removing the Horizontal Rule between Procedures

Features:

OPTIONS option:: PAGEBREAK=NO

Other features:

GPLOT procedure

PRINT procedure

GOPTIONS statement

Details

HTML documents are usually formed as one continuous page of information without any page breaks. When the document is printing, objects falling on the margins of the printed page might be split across two pages. To prevent this, the ODS HTML destination inserts page breaks between each output object by inserting a paragraph tag that automatically includes a page break command. When printed, each output object appears on a separate page. Sometimes, with smaller documents, it might be desirable to remove these hardcoded page breaks. This example shows you how to remove the page breaks.

Program

options nodate obs=10;
goptions xpixels=500 ypixels=400;
ods html  options(pagebreak='no');
title "Student Correlation";
symbol1 font="albnay amt" value='O' height=15pt color=pink;
symbol2 font="albnay amt" value='X' height=15pt color=lib;
proc gplot data=sashelp.class;
plot height*weight=sex / des="" name="name";  
run;
title;
proc print data=sashelp.class;
run;

quit;
ods html close;

Program Description

Set the options and goptions.The OPTIONS statement sets the global options. The GOPTIONS statement set the graphical options.
options nodate obs=10;
goptions xpixels=500 ypixels=400;
Specify that no page break is created. By default, there is a page break that resolves as a horizontal rule between the graph and the table when the two procedures are run. The PAGEBREAK= NO suboption specifies that no page break is drawn between the two output objects.
ods html  options(pagebreak='no');
Create the graph. The SYMBOL statements and the GPLOT procedure create the graph.
title "Student Correlation";
symbol1 font="albnay amt" value='O' height=15pt color=pink;
symbol2 font="albnay amt" value='X' height=15pt color=lib;
proc gplot data=sashelp.class;
plot height*weight=sex / des="" name="name";  
run;
Print the output. The PRINT procedure prints the data set.
title;
proc print data=sashelp.class;
run;

quit;
ods html close;

Output

Default Output with Page Break
Default Output with Page Break
Output with No Page Break
Output with No Page Break