If you wish to output a graph on any ITS-supported printer and you're using SAS for UNIX, a Graphics Stream File will be essential, even if no transfer to another operating system is anticipated. (Patrons using SAS for Macintosh or SAS for Windows have the option of printing graphs directly from the Graphics window by clicking File>Print; this method isn't recommended for UNIX SAS/Graph.) Most ITS printers accept PostScript files, and special drivers have been set up in the UNIX environment for PostScript use. These drivers are listed and documented below, as is the procedure for creating and sending a PostScript Graphics Stream File to an ITS printer from a UNIX session.
GSFs are created by specifying the appropriate output device
driver to the
DEVICE= parameter of the GOPTIONS statement (the
GOPTIONS statement is discussed
below) and by directing the output of the batch or
interactive job to a file, rather than to a screen or other
hardcopy device.
The ITS documentation on SAS in each operating
system has examples and instructions.
This documentation can be found at:
For full details on creating Graphics Stream Files see the SAS/Graph manuals listed in the References section at the end of this document. For more information on the GOPTIONS statement, see below, and the References.
In summary, to generate a graph in interactive SAS to be printed at a PostScript printer from a UNIX SAS/Graph session, write a program that includes a FILENAME statement that points to a file to hold the PostScript output, and a GOPTIONS statement as in the following example:
FILENAME NICKNAME '<--file specifications for UNIX, Mac or PC-->';
GOPTIONS RESET=ALL DEVICE=PSUSCSM GSFNAME=NICKNAME
GSFLEN=80 HSIZE=7 VSIZE=9 BORDER NOPROMPT;
data temp; input a b;
cards;
56 87
56 89
57 89
57 90
57 91
58 92
68 94
79 98
;
title1 f=duplex c=green 'This is my test graph';
symbol1 c=red i=join v=star;
proc gplot; plot a*b;
run;
HSIZE=, VSIZE= and BORDER parameters are
optional. Note also that some GOPTIONS may differ from system to
system; the ITS Help documentation for SAS in each system has more
specific examples. The graph in the example above will be 7"
wide, 9" tall, and will have a border around the entire area.It is also possible, of course, to send Graphics Stream Files to printers other than those known to the system you are using to generate the graphs -- indeed, virtually any printer anywhere -- and to create GSFs in systems other than UNIX, Windows or Macintosh. When generating a graph that is to be transferred for printing to a system other than the one on which it was generated, keep in mind that the file containing the graph output must be sent in BINARY mode in whatever file transfer process you use. Also, the outside printer will have certain requirements for the format (usually PostScript, but this varies) and the medium (diskette, tape, ftp, etc.) used for the file that is to be printed as a graph.
USC's
Print Center
at the Bookstore
is an example of an outside place to print graphs
generated by SAS.
They have color printers up to 11"x14" which
will print graphs encoded in PostScript, using the drivers
described in this document (e.g., PSUSCSM and
PSUSCLG). Please note, however, that it is strongly recommended
that you test your graph output on cheap, monochrome printers
such as ps_lvlg40, as many outside printing establishments
can be expensive.
For a list of printers like ps_lvlg40 that your account can access,
type printers at your UNIX prompt.