Chapter Contents |
Previous |
Next |
SAS/GRAPH Software: Reference |
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.
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
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 |
The following alternatives are available for specifying the output location for the HTML and GIF files:
Output from HTML or WEBFRAME Driver | Output from ODS |
---|---|
The driver creates an aggregate file storage location named sasgraph. The sasgraph location is created under the storage location where the SAS session was started. | In most operating environments, the default location is the storage location where the SAS session was started. |
A fileref that defines the location of Web output must point to an aggregate file storage location. The following FILENAME statement defines the fileref outfiles:
filename outfiles 'path-to-Web-server-space';After defining the fileref, you can use it as needed to direct the output files. The place to specify it depends on the approach you use to generate the Web output:
Output from HTML or WEBFRAME Driver | Output from ODS |
---|---|
You can specify the fileref on the GSFNAME= graphics
option:
goptions gsfname=outfiles; |
Specify the fileref on the ODS HTML statement's PATH=
or GPATH= options. To direct all files to the same location, use only PATH=.
To direct the HTML files to one location and the GIF files to another, use
both PATH= and GPATH=. The following specification directs all ODS output to the same location: ods html body='myfile.html' path=outfiles; |
ods html body='myfile.html' path='path-to-Web-server-space';
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 |
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.