To create GIF files with SAS, you must use SAS 6.09 at TS450 or higher.
I have created two jobs that demonstrate how to create GIF files with
SAS:
Sample 1 - Map of Texas with the
default black background
Sample 2 - Map of Texas with a
"transparent" background which makes a better looking
web graphic.
After running these jobs, you will have two partitioned
datasets with two GIF files (as PDS members)
that are ready for downloading to a PC, copied to a web server
location, etc.
You would take the concepts from these sample jobs and modify your
current SAS jobs to make them GIF-friendly:
To get GIF output, you need your GOPTIONS statement changed
to output to "dev=gif":
goptions dev=gif gsfname=out gsfmode=replace;
The "dev=gif" device type comes from SAS.
The sample %imgsize SAS macro was provided by SAS and
should be copied instream for specifying the dimensions of
the graphic file when invoked:
%imgsize(w=300, h=200, dpi=95, rows=30, cols=50);
The second sample job creates a transparent GIF file. This
job makes a copy of the GIF device type and makes '01'x
the "transparent" color. This new device type is saved in
the user's sas.data file. This only need to be performed
once. The goptions in this sample job is now directed to the
giftrans "device".
See more GIF information on the
SAS GIF page. There is more information available by taking
the web enablement option off their main web page at
SAS.
Here is the GIF file created the the
Sample 1 job:
Here is the GIF file created the the
Sample 2 job:
Notice that it has a Transparent background!!!!
You might have noticed also that some of the white text was lost near
the bottom on this transparent GIF (on either side of the little box).
To prevent this from happening, you need to tell SAS to
not to use any color in your GIF file that is the same
as the background color on your web page.
Below is the same exact transparent GIF file as created by the
Sample 2 job but shown in a HTML table row
that has a orange background. Note that the white text near the bottom
which was "lost" when shown on the white background can now be seen on
the orange background: