Chapter Contents

Previous

Next
SAS/GRAPH Software: Reference

About the Output Files Generated for the Web

If you use SAS/GRAPH to generate Web output, then the output must include at least one HTML file. If you use the GIF device driver for the graphs, then the output also includes at least one GIF file. An HTML file contains the HTML language elements required to view the output in a Web browser, and a GIF file contains graphics output.

An HTML file that is generated by SAS/GRAPH always has the elements needed to reference each graph that is produced by the SAS program. HTML Tags Used to Reference Graphs shows the HTML tags that SAS/GRAPH creates as needed to reference graphs.

HTML Tags Used to Reference Graphs
Tag References ...
<IMG> the location and name of a GIF file
<APPLET> the location and name of a Java applet
<OBJECT> the location and name of an ActiveX control

For example, this tag references an image named barchart.gif, which resides in the same location as the HTML file (because no other location is indicated):

<IMG SRC="barchart.gif">
How an HTML File References a GIF File shows the relationship between an HTML file's <IMG> tag and the GIF file.

How an HTML File References a GIF File

[IMAGE]

To view Web output, use a Web browser to view the HTML file, which automatically displays the graph that is referenced by the <IMG>, <APPLET>, or <OBJECT> tag.

If the output files are located in your file system, then users with access to that file system can directly open the HTML file. If the output files are located on a Web server, then users with Internet access to the World Wide Web can access the HTML file through its uniform resource locator (URL).


Specifying Output Locations for HTML and GIF Files

When you use the HTML or WEBFRAME device drivers, or when you use SAS/GRAPH with ODS and specify the GIF device driver, SAS/GRAPH creates all of the HTML and GIF files you need to view the output. In these cases, you must specify a location in your file system where you want the output files to be stored. This location must be an aggregate file storage location (for example, a directory or PDS); it cannot be a file.

The following alternatives are available for specifying the output location for the HTML and GIF files:


Naming Conventions Used for HTML Files

The names that are assigned to HTML files depend on the approach you use to generate the Web output:

Output from HTML or WEBFRAME Driver Output from ODS
You cannot specify a name for the HTML files. Both drivers always create a file named index.html, which is the file that should be viewed in the browser.

With the HTML driver, index.html is the only HTML file that is created. With the WEBFRAME driver, additional HTML files are created, which the driver also names.

The HTML files always replace the HTML files from previous procedure runs, unless the output is directed to a different location.

You assign filenames for the HTML files you want created. You assign the names on the BODY=, CONTENTS=, PAGE=, and FRAME= options.

While the HTML destination is open, each specified HTML file remains open and additional output is appended to the file, until you open an alternative file for the output type or close the HTML destination. If you run the program again at another time without changing the filenames specified, the output from the current program run replaces the output from the previous program run.



Naming Conventions Used for GIF Files

When you use SAS/GRAPH to generate Web output, the graphs produced in the program are always saved in two formats: GRSEG catalog entries and GIF files. In all cases, the GIF filenames are always derived from the catalog entry names of the corresponding graphs.

For example, you can use a procedure's NAME= option to assign a name of up to eight characters to the catalog entry. If you assign the name MYGRAPH to the catalog entry, SAS/GRAPH names the GIF file mygraph.gif. If you do not use NAME=, SAS/GRAPH names the entry with the first eight characters of the procedure name (for example, GCHART), in which case SAS/GRAPH names the GIF file gchart.gif. (For more information on catalog entry names, see Names and Descriptions of Catalog Entries.)

SAS/GRAPH does not replace existing GRSEG entries when a procedure creates a new entry of the same name. Rather, it adds a number to the duplicate name to make it unique. For example, if you use a procedure's NAME= option to name an entry MYGRAPH and an entry named MYGRAPH already exists in the output catalog, SAS/GRAPH names the new entry MYGRAPH1, and then names the GIF file mygraph1.gif. Catalog entry names are limited to eight characters, so if the duplicate name has eight characters, SAS/GRAPH replaces the final character with the added number.

To replace an existing catalog entry, your program must first use the GREPLAY procedure to delete the existing catalog. For example, assume that the output catalog is the default, WORK.GSEG, and assume that you use BY-group processing on the GCHART procedure to run a program that generates three catalog entries that are named GCHART, GCHART1, and GCHART by default. To run the same program and ensure that the catalog entries receive the same names, you must first run the following GREPLAY procedure to delete the three existing catalog entries before generating the new entries that have the same names:

proc greplay igout=work.gseg nofs;
   delete gchart gchart1 gchart2;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.