Metaview HTML Generator

Using the Metaview HTML Generator

The Metaview HTML Generator is a macro that you include in your SAS programs when you are generating SAS/GRAPH output that you want to display in a Web browser. When you include the META2HTM macro in your program, it captures information generated by SAS software and writes metadata that is consumed by the Metaview Applet. The Metaview Applet enables you to display your graphics in a Web browser.

To use the Metaview HTML Generator, include the META2HTM macro calls in your SAS program. Information about how to include the macro and its arguments are provided below. You should also become familiar with all of the formatting possibilities provided by the META2HTM attributes. The attributes are documented in the syntax reference.

Note: For SAS 9.2 or later, the META2HTM macro is no longer supported. The documentation on this Web site is for Release 8.2 or earlier of SAS. Please migrate your applications to use ODS and the JavaMeta device driver.

Capturing the Results of SAS/GRAPH Output

To capture the output and write the HTML file, complete the following steps:

  1. Add a META2HTM macro statement with a CAPTURE=ONargument to your SAS program. Include the statement at the location where you want to begin capturing data.

    Your SAS program can perform many tasks that do not produce results that are necessary for viewing graphics using the Metaview Applet. At a minimum, your GOPTIONS statement and your graphics procedure should appear between the CAPTURE=ONand CAPTURE=OFFstatements.

    The following is example code for turning the capturing on:

         %meta2htm(capture=on,
                   htmlfref=_webout,
                   openmode=replace,
                   archive=http://web_server_name/sasweb/graph/metafile.zip);     
     
    

  2. For every CAPTURE=ONstatement, you must include a CAPTURE=OFFstatement. Place the CAPTURE=OFFstatement after the section of your SAS program that is generating the SAS/GRAPH output to be viewed using the Metaview Applet.

    The following is example code for turning capturing off:

         %meta2htm(capture=off,
                   htmlfref=_webout,
                   openmode=append);
           
    

  3. Submit the program.
  4. To look at your HTML file, enter the URL (including the HTML filename) in your browser window.

The META2HTM macro calls that are shown in the previous steps show only a few of the available arguments. In addition to the arguments shown above, you can include any other attributes that define the formatting characteristics of your page. For example, specify the background color for the Web page, the type of separator, and the browser window title.

The following is an example that uses many of the arguments that are described in the macro reference documentation.

     %meta2htm(capture=on,
               htmlfref=_webout,
               bgtype=color, bg="#dddddd",
               brtitle=Metaview Applet Test,
               center=y,
               charset=iso-8859-1,
               doctype=,
               bdclass=bodyClass,
               height=770,
               width=610,
               codebase=/sasweb/graph/,
               archive=metafile.zip,
               align=center,
               hspace=1,
               vspace=2,
               cback=#dddddd,
               sshref1=my.css,
               sstype1=text/css,
               ssrel1=StyleSheet);

     goption device=javameta;
     proc gtestit;
     run;
     %meta2htm(capture=off,
               htmlfref=_webout,
               openmode=append,
               center=y,
               septype=none,
               spclass=saspowerClass);

Notes About Capturing Results

The following notes contain information that you should keep in mind when using the META2HTM macro.