Printing Graphics Output


You can print your SAS/GRAPH output on hardcopy devices such as laser printers and plotters . In addition, you can send the output to cameras or film recorders . Regardless of the destination, there are several ways to produce hardcopy of your SAS/GRAPH output:

  • Print SAS/GRAPH program output directly to a hardcopy device.

  • Print SAS/GRAPH program output by creating an external file of graphics commands called a graphics stream file (GSF), saving it to disk, and printing the file with host commands.

  • Print the displayed graph directly from the GRAPH window or the Graphics Editor window.

The following sections provide a general description of these methods .

Operating Environment Information: Whatever way you choose, the exact steps for printing graphics depend on the hardcopy device you are using and on the environment in which you are using it. For complete information on printing graphics output in your operating environment, see the SAS Help facility for SAS/GRAPH and the SAS companion for your operating environment.

Printing Directly to the Device

You can send graphics output directly to a hardcopy device by sending the graphics commands directly to the device or to a device port.

On most systems you can use any of the following methods to print directly to a device:

  • Use a FILENAME statement, a GOPTIONS statement, and a SAS/GRAPH native device driver. The FILENAME statement defines a fileref that points to the print commands. The GOPTIONS statement references the fileref, assigns the device, and specifies any additional parameters.

  • Use the GDEVICE procedure to modify a SAS/GRAPH device entry to spool output directly to a printer. See Chapter 31, The GDEVICE Procedure, on page 915 for information on adding host commands to a device entry.

  • Use the universal printing interface.

For detailed instructions on each of these methods, refer to the SAS Help facility for SAS/GRAPH.

Saving and Printing a Graphics File

There are two steps to printing graphics output from an external file:

  1. Save your SAS/GRAPH output in an external file. For information on creating external files, see About Exporting SAS/GRAPH Output on page 59 and the SAS Help facility for SAS/GRAPH.

  2. Print the file from your host environment. The host commands vary across operating environments and spooling utilities. See the SAS companion for your operating environment for more information on printing.

You can perform these two steps separately or combine them by incorporating the host printing commands into your program or device driver. In any case, you must choose a graphics file format that is compatible with your hardcopy device. For example, if you are using a PostScript printer, be sure to specify one of the PostScript device drivers supplied in SASHELP.DEVICES. This technique is frequently used on multi- user systems in which the output devices are shared.

You can use any of the following methods to create and print an external file:

  • Use the FILENAME and GOPTIONS statements to create the graphics stream file. To route the output directly to the printer, include the print commands in the SAS/GRAPH statements. Otherwise, save the file to disk and use a host command to spool the file to a spooler for the device.

  • Use the GDEVICE procedure to modify a SAS/GRAPH device driver to save the output to an external file and spool the output directly to a printer. See Chapter 31, The GDEVICE Procedure, on page 915 for information on modifying device entries.

  • Use the universal printing interface.

For detailed instructions on each of these methods, refer to the SAS Help facility for SAS/GRAPH.

Printing From a Window

In some operating environments you can print directly from the GRAPH window or the Graphics Editor window by using the PRINT command in conjunction with the TARGETDEVICE= graphics option. To do this, use TARGETDEVICE= to specify the printer driver and use DEVICE= to specify the driver for the terminal or display on which you want to preview the output.

The driver specified by TARGETDEVICE= determines the characteristics of the printed output and sends the graphics output to either an output device or a graphics stream file. The driver specified by DEVICE= controls some characteristics of the output displayed in the window. In some cases, you may need to use a FILENAME and GOPTIONS statements to define the destination of the PRINT command.

Note: If you have not previously specified TARGETDEVICE= when you issue the PRINT command in the window, SAS/GRAPH prompts you for a device for the printed output. However, in this situation the output that is sent to the printer reflects the characteristics of the display device driver. To ensure that your printed output matches what you see on your display, always use TARGETDEVICE= with the PRINT command.

For details on printing directly from the GRAPH or Graphics Editor window, refer to the SAS Help facility for SAS/GRAPH. See TARGETDEVICE on page 355 for a complete description of TARGETDEVICE=.

Previewing Output

If you want to preview how a graph is going to appear on another device before you send it to that device, you can use the TARGETDEVICE= graphics option. For example, to preview output on your display as it would appear on a color PostScript printer, include TARGETDEVICE= in a GOPTIONS statement and specify the driver for the printer:

 goptions targetdevice=pscolor; 

The output is displayed on your screen using

  • the orientation of the target device. As a result, the graph may not cover the entire display area of the preview device.

  • the values of either the LCOLS and LROWS pair or the PROWS and PCOLS pair, depending on the orientation of the target device.

  • the default colors list of the target device.

  • the values of the HSIZE and VSIZE device parameters for the target device.

  • the value of the CBACK device parameter for the target device.

All other device parameter values, including the destination of the output, come from the current device entry. Therefore, the output displayed by TARGETDEVICE= may not be an exact replication of the actual output, but it is as close as possible.

See TARGETDEVICE on page 355 for a complete description of TARGETDEVICE=.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net