Here is an example that
uses ODS to create an HTML file that references four PNG files that
are created by a
SAS/GRAPH procedure. The GCHART procedure in this example uses BY-group processing
to display the results of each of the four quarters of the year. Consequently,
the procedure produces four separate PNG files. Only the first graph
is shown here. To see all of the graphs, you must scroll down the
page in your browser.
Generating PNG Output Using ODS
The following is the
complete SAS code for this example. In this example, the output files
are sent to the default location. If you want to send the output files
to a different location, add the BODY= option to the ODS HTML statement
to specify the new location of the output files. You can specify the
complete path and filename with the BODY= option (or the FILE= option,
which is the same), or you can specify the path separately using
the PATH= option, and just the filename with the FILE= or BODY= option.
See
SAS Output Delivery System: User's Guide for information about the ODS HTML statement.
If you want to send
the PNG files to a separate location, add the GPATH= option to the
ODS HTML statement to specify the new location for the PNG files.
/* Create data set from sashelp.prdsale */
data prdsummary;
set sashelp.prdsale;
where year=1993 and (country = "GERMANY" or country = "CANADA")
and region="EAST" and division="CONSUMER" and
(product="SOFA" or product="TABLE" or product="BED");
run;
/* Sort the data set by quarter */
proc sort data=work.prdsummary;
by quarter;
run;
ods html style=seaside;
goptions reset=all border;
title1 "1993 Sales";
proc gchart data=prdsummary(where=(year=1993));
vbar3d country / sumvar=actual subgroup=product sum;
by quarter;
run;
quit;
ods html close;
ods html;
Notice that a device
is not specified in the GOPTIONS statement in this example. ODS uses
the PNG device as the default device for the HTML destination.