How do I print SAS graph files while working on the Research Computing server?
The general procedure is to:
* Create a graphics file from SAS.
* Send this file to a printer using the UNIX/Linux lp command.
Create a graphics file from SAS
To print a graphics file from SAS on Emerald, follow these steps:
1. Specify an output fileref (i.e., a file name for the graphics output in a specified directory where you want to save the file).
2. Set the goption "gsfname" equal to the fileref you designated in the previous step.
3. Set the goption "device" equal to an appropriate PostScript device driver. (*For a complete list of SAS device drivers, use proc gdevice.) (e.g., applelw, ps300, or pscolor).
4. Create your graphics using an appropriate SAS procedure (e.g., proc gplot, proc g3d, etc.).
5. Print the graphics file. The UNIX lp command sends the graphics file to the printer.
The following SAS program illustrates how to save a SAS graph (created from the data set, CLASS, from the SASUSER library) as a graphics stream file (.gsf ):
<br />
filename outsas '~/sasgraph.gsf' ; /* Output fileref */ <br />
<br />
goptions device=applelw /* Generic postscript device */<br />
<br />
gsfname=outsas /* Fileref for output file <br />
<br />
* must be on prior FILENAME */ <br />
<br />
gsfmode=replace; /* Write over old output file */ <br />
<br />
proc gplot data=sasuser.class; /* Create graphics */ <br />
<br />
plot weight*height; <br />
<br />
run; <br />
<br />
quit;<br />
Send this file to a printer using the UNIX/Linux command
Now send the graphics file to the printer. For example, at the Unix/Linux prompt, use the following code to print the graph sasgraph.gsf, on the printer in the IRSS lab, lp48:
<br />
$ lp -d lp48 sasgraph.gsf<br />
Read more about Printing from Research Computing servers.