ODS HTML Statement


The ODS HTML statement opens or closes the HTML destination.

Used by:

  • GANNO, GAREABAR, GBARLINE, GCHART, GCONTOUR, GFONT, GIMPORT, GMAP, GPLOT, GPRINT, GRADAR, GREPLAY, GSLIDE, GTESTIT, G3D, G3GRID procedures

Requirements:

  • If the HTML destination is open , the BODY= argument is required.

  • Operating Environment Information: On mainframes, either GPATH= or PATH= is also required.

Description

This section describes the ODS HTML statement as it relates to SAS/GRAPH procedures.

The ODS HTML statement opens or closes the HTML destination. If the destination is open, it produces output that is written in Hyper Text Markup Language (HTML). If DEVICE=GIF, graphics output is produced as GIF files, and the HTML files display the GIF files that are created by the SAS/GRAPH procedures. If DEVICE=JAVAMETA, graphics output is produced as metagraphics data, which provides graphs that are exact replicas of their corresponding GRSEG graphs but that are interactive in a Web page. Procedures GCHART, GCONTOUR, GMAP, GPLOT, and G3D can also be used with the JAVA and ACTIVEX drivers, both of which generate JavaScript in the output HTML file. If DEVICE=JAVA, then a Java-enabled browser can use the script to render graphs as a SAS/GRAPH Applet for Java. If DEVICE=ACTIVEX, then an ActiveX-enabled browser can use the script to render graphs as a SAS/GRAPH Control for ActiveX.

Syntax

ODS HTML HTML-file-specification(s) action

  • <ANCHOR= string >

  • <ARCHIVE= string >

  • <ATTRIBUTES= ( attribute-name1 = attribute-value-1 ...

  • attribute- name -n = attribute-value=n ) >

  • <CODEBASE= file-location <(URL= Uniform-Resource-Locator )>>

  • <BASE= base-text >

  • <GFOOTNOTE NOGFOOTNOTE>

  • <GPATH= graphics-location <(URL= Uniform-Resource-Locator NONE )>>

  • <GTITLE NOGTITLE>

  • <HEADTEXT= HTML-for-document-head >

  • <METATEXT= HTML-for-document-head >

  • <NEWFILE= starting-point >

  • <PARAMETERS= ( parameter-name1 = parameter-value-1 ...

  • parameter-name-n = parameter-value=n ) >

  • <PATH= file-location <(URL= Uniform-Resource-Locator NONE )>>

  • <RECORD_SEPARATOR= string NONE>

  • <STYLE= style-definition >

  • <TRANTAB= translation-table >;

  • action can be one of

    • CLOSE

    • EXCLUDE

    • SELECT

    • SHOW

    Note: For information on EXCLUDE, SELECT, and SHOW, see SAS Output Delivery System: User s Guide .

  • HTML-file-specification(s) can be one or more of

    • BODY= file-specification

    • CONTENTS= file-specification

    • FRAME= file-specification

    • PAGE= file-specification

    Note: BODY= is required. If you use FRAME=, you must also use CONTENTS= or PAGE=.

Required Arguments

One of these arguments is required.

CLOSE

  • closes the HTML destination and closes any HTML files that are currently open.

  • Featured in: Example 8. Creating a Simple Web Page with the ODS HTML Statement on page 245.

EXCLUDE

  • excludes output objects from the HTML destination.

SELECT

  • selects output objects to send to the HTML destination.

SHOW

  • writes to the SAS log the current selection or exclusion list for the HTML destination.

HTML-file-specification

  • opens the HTML destination and specifies the HTML file or files to write to. You can open up to four HTML files; the file designated by BODY= is required. Whenever you open one of these files, it remains open until you either

    • close the HTML destination with ODS HTML CLOSE

    • open a different file for the same HTML file specification.

  • HTML-file-specification can be one or more of the following arguments. Values for file-specification follow the arguments.

    • BODY= file-specification

    • FILE= file-specification

      • identifies the file that contains the HTML version of the procedure output. With SAS/GRAPH, the body file contains references to the graphs. If DEVICE=GIF, the graphs are stored in separate GIF files. When you view the body file on a browser, the graphs are automatically displayed.

      • Featured in: Example 8. Creating a Simple Web Page with the ODS HTML Statement on page 245 and Example 10. Creating a Bar Chart with Drill-down for the Web on page 255.

    • CONTENTS= file-specification

      • identifies the file that contains a table of contents to the ODS output that is produced while the HTML destination is open. The contents file contains links to the body file(s).

        The text of links to graphics output is taken from the description field of the GRSEG catalog entry. Use the DESCRIPTION= option in the procedure to change the link text.

        You can display a contents file alone or in conjunction with a frame file. If you display a contents file directly (without using a frame file), selecting a link opens the associated body file, and the contents file is no longer displayed. If you display a contents file with a frame file, the contents file always remains available in the left frame, and selecting a link opens the associated body file in the right frame.

    • FRAME= file-specification

      • identifies a file that points to the body file and to either the table of contents file or the page file, or both. If you specify FRAME=, you must also specify either CONTENTS= or PAGE= or both.

        When you open the frame file in the browser, it displays the Table of Contents or the Table of Pages or both in the left frame, and the body file in the right frame.

    • PAGE= file-specification

      • identifies the file that contains a table of pages to the ODS output that is produced while the HTML destination is open.The pages file contains links to the body file(s). ODS produces a new page of output whenever a procedure explicitly specifies for a new page. The SAS system option PAGESIZE= has no effect on pages in HTML output.

  • File-specification identifies the file or SAS catalog to write to and can be one of the following:

    • fileref (<URL= Uniform-Resource-Locator > <NO_BOTTOM_MATTER> <NO_TOP_MATTER> <DYNAMIC>)

    • external-file (<URL= Uniform-Resource-Locator > <NO_BOTTOM_MATTER> <NO_TOP_MATTER> <DYNAMIC> )

    • entry .HTML (<URL= Uniform-Resource-Locator > <NO_BOTTOM_MATTER> <NO_TOP_MATTER> <DYNAMIC> )

    • where

    • external-file

      • is the physical name of an external file to write to. For information on specifying external files, see the SAS companion for your operating environment.

    • fileref

      • is a fileref that has been assigned to an external file. The fileref must refer to a single file; it cannot point to an aggregate file storage location. Use a FILENAME statement to assign a fileref. See also FILENAME Statement on page 28.

    • entry .HTML

      • specifies an entry in a SAS catalog to write to.You must also specify a library and catalog. See the discussion on PATH= ODS HTML Statement on page 164.

    • URL= Uniform-Resource-Locator

      • provides a URL for file-specification . ODS uses this URL instead of the file name in all the links and references that it creates that point to the file.

        This option is useful for building HTML files that may be moved from one location to another. If the links from the contents and page files are constructed with a simple URL (one name), they work as long as the contents, page, and body files are all in the same location.

    • NO_BOTTOM_MATTER

      NOBOT

      • omits the bottom matter for the file. By default, when you close a file that was open for HTML output of any kind, ODS writes some HTML to the bottom of the file. This HTML ends the file so that it can be viewed cleanly in a browser.

        If you wish to leave a file in a state that you can append to, use NO_BOTTOM_MATTER on the BODY= option on the ODS HTML statement that opens the file. This option, in conjunction with NO_TOP_MATTER makes it possible for you to add output to a file that already exists and to put your own HTML code in the file between pieces of output.

        To use NO_BOTTOM_MATTER, you must use a fileref for file-specification . The FILENAME statement that defines the fileref must include the host-specific option that opens the file for appending.

        When you are opening a file that ODS has previously written to, you must use ANCHOR= to specify a new base name for the anchors to avoid duplicating anchors that already exist in the file. See the discussion About Anchors on page 168.

    • NO_TOP_MATTER

      NOTOP

      • omits the opening matter for the file. By default, when you open a file for HTML output of any kind, ODS writes some HTML to the top of the file.

        If you wish to append ODS output to an existing file, you must open the file with NO_TOP_MATTER on the BODY= option on the ODS HTML statement that opens the file. This option, in conjunction with NO_BOTTOM_MATTER makes it possible for you to add output to a file that already exists and to put your own HTML code in the file between pieces of output.

        To use NO_TOP_MATTER, you must use a fileref for file-specification . The FILENAME statement that defines the fileref must include the host-specific option that opens the file for appending.

        When you are opening a file that ODS has previously written to, you must use ANCHOR= to specify a new base name for the anchors to avoid duplicating anchors that already exist in the file. See the discussion About Anchors on page 168.

    • DYNAMIC

      • enables you to send HTML output directly to a web server instead of writing it to a file. This option sets the value of the HTMLContentType= attribute.

        By default, if you do not specify DYNAMIC, ODS sets the value of HTMLContentType= for writing to a file.

      • Note: If you specify the DYNAMIC suboption with any file specification in the ODS HTML statement, you must specify it for all the file specifications in the statement.

Note: Regardless of how you specify the file, you may need to include the extension .HTML or .HTM on the file name. Some browsers require one of these extensions in order to read the file.

Note: For additional information, refer to the Output Delivery System .

Using the ODS HTML Statement

While the ODS HTML destination is open, you can submit as many ODS HTML statements as you like, and you can place them anywhere in your SAS/GRAPH program. This enables you to open new files, change anchor names , or specify a new location for graphics output whenever you like. At the end of your ODS HTML processing step, submit ODS HTML CLOSE to close the destination and all open files.

Specifying a Destination for ODS HTML Output

When you use the ODS HTML statement for SAS/GRAPH, you must do the following:

  • assign a body file with the ODS HTML BODY= option

  • specify DEVICE=GIF (or TARGET=GIF) in a GOPTIONS statement to create the GIF files. By default with ODS processing, the GIF files are stored in the current directory. To specify a destination for all the HTML and GIF files, use the PATH= option. To store the GIF files in a different location than the HTML files, use the GPATH= option to specify a location for the GIF files, and PATH= to specify the location of the HTML files. In both cases,the destination must be an aggregate storage location. With procedures GCHART, GCONTOUR, GMAP, GPLOT, and G3D, you can also use DEVICE=ACTIVEX to create graphs as ActiveX controls, or DEVICE=JAVA to create graphs as Java applets. The controls or applets are defined within the body file.

Note: For more information, see SAS Output Delivery System: User s Guide .

For more information about the output files generated for use with the Web, see Types of Web Presentations Available on page 370.

About Anchors

ODS HTML automatically creates an anchor for every piece of output generated by the SAS procedures. An anchor specifies a particular location within an HTML file. In SAS/GRAPH, an anchor usually defines a link target such as a graph whose location is defined in an IMG element.

Note: For additional information, refer to the Output Delivery System

In order for the links from the contents, page, or frame file to work, each piece of output in the body files must have a unique anchor to link to. The anchor for the first piece of output in a body file acts as the anchor for that file. These anchors are used by the frame and contents files, if they are created, to identify the targets for the links that ODS HTML automatically generates.

By default, the first anchor is named IDX and all subsequent anchors generated while the HTML destinations remain open increment that name. Anchor values increment while the ODS HTML destinations remain open unless you use ANCHOR= to assign a new value. Anchor values continue to increment when you open new body files, start new procedures, or produce different types of output.

Controlling the anchor name is useful when you create a graph with drill-down capability. In this case, you must create a variable that contains the names of the anchors that are the targets for the different areas of the graph that the user may click on.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net