Printing Reports and Graphics |
When printing graphics, you can specify various options that enable you to control your printout. Using the Catalog management item, you can create a personal catalog of graphics device drivers customized for your own use. You must have SAS/GRAPH software licensed to use this feature.
Additional Information |
For additional information on printing graphics, refer to SAS/GRAPH: Reference and SAS/GRAPH Software: Using Graphics Devices for your operating environment.
Overview |
This section explains how to copy and modify a SAS/GRAPH device driver. For example purposes, the driver for an HP Series IIIsi laser printer in PCI mode is copied. You will select the driver for printing, create and display a bar chart, change the graphic defaults for the bar chart, and print the bar chart from the Graph window. You also print the bar chart directly to the printer without first displaying the chart in the Graph window.
Note: You do not need to set up your device drivers every time you print a graphic.
In this section, the HP LaserJet Series IIIsi laser printer is modified for use under the z/OS operating environment. For information on other printers and operating environments, refer to the SAS companion documentation for your operating environment and the documentation for your printer.
Modifying Device Drivers |
Select Tasks Setup Environment Graphics options... Catalog management...
The Graphics Device Catalog Management window appears as shown in the following display.
Graphics Device Catalog Management Window
The Catalog Management window enables you to create a personal catalog of graphics device drivers. You can use this feature to select the graphics devices you want from the device catalog that SAS supplies and store them in a personal device catalog. You can then modify these drivers to customize them for your use. If you set up a personal graphics device driver catalog, when you select an item that lists graphics devices, only the device drivers in your personal catalog appear.
The Assign a New Libref window appears as shown in the following display.
Assign a New Libref Window
Type the name of the SAS data library in which you want to store your graphics devices in the Name of the SAS data library field. The format for typing in the library name is determined by your operating environment.
This example uses USERID.SAS.GRPHDEVS as the SAS data library name under the z/OS operating environment. Examples of SAS data libraries for various operating environments are listed in the following table.
Operating Environment | What You Type | Example |
---|---|---|
z/OS | an operating system data set name | USERID.SAS.GRPHDEVS |
OpenVMS | the name of a device and directory. | DEVICE:[GRPHDEVS] |
UNIX | the name of a directory or subdirectory | /u/userid/grphdevs |
Windows | the name of a drive and directory or subdirectory | C:\GRPHDEVS |
Select OK. A message appears indicating the libref was assigned successfully.
If the SAS data library does not exist, one of the following occurred, depending on your operating environment. See the SAS companion documentation for your operating environment for more information.
Under some operating environments, such as UNIX, the directory must exist or you must first create it before you copy device drivers to it. If the directory does not exist, an error message appears indicating that the SAS data library does not exist.
Under some operating environments, such as z/OS, a prompt appears asking if you want to create the SAS data library you typed in the Name of the SAS data library field. Type Y to create the library. The operating environment may ask you if you want to delete or catalog the library once it has been created. Type C to catalog the library.
You assign the libref GDEVICE0 to your personal graphics device driver catalog so that the devices displayed for you to choose from are those in your personal device driver catalog. Since the default libref is GDEVICE0, you cannot type a libref in the Libref field.
After you have assigned the GDEVICE0 libref, you can copy device drivers from the catalog supplied by SAS into your personal graphics device driver catalog.
Select Goback to return to the Graphics Device Catalog Management window.
Select Copy drivers. The Select an Entry window appears, as shown in the following display, with a list of device drivers that you can choose from for your personal graphics devices catalog.
Catalog Directory Window
Scroll to the right to display the desired driver and select it.
Select OK to return to the Graphics Device Catalog Management window.
Select Modify drivers; the graphics devices Directory window appears, as shown in the following display. In this example, the driver for an HP Laserjet Series IIIsi was copied.
Graphics Devices Directory Window
Type S in the CMD selection field to the left of the desired driver to select it and press ENTER.
The Detail window appears as shown in the following display.
Detail Window
Note: To display a list of commands that can be typed in the CMD selection field next to each graphics device, type ? in the selection field and press ENTER.
Select Host File Options Window from the Tools menu. The Host File Options window appears as shown in the following display.
Host File Options Window
Note: You can change the values in the Host File Options window on all operating environments. However, most of the changes listed in this section are specific to the z/OS operating environment.
Modify the options in the Host File Options window as needed.
The Gaccess field specifies the format and destination of graphics data written to a device or graphics stream file (GSF).
The Gsfmode field specifies the disposition of records written to a graphics stream file or to a device or communications port by the device driver.
The Gsflen field controls the length of the records written to the GSF.
The Devtype field specifies the information required by SAS/GRAPH routines to determine the nature of the output device.
The Gprotocol field specifies the protocol module to use when routing output directly to a printer or creating the GSF to send to a device attached to your host by a protocol converter.
Select Close file at end of each graph to send the graphic to the printer as soon as you choose to print it, not when the graph procedure ends.
For more information on other printers and operating environments, refer to the SAS companion documentation for your operating environment and the documentation for your printer.
Select File from the menu bar, then select Close. A message appears asking if you want to modify the driver supplied by SAS.
Select Yes since the driver you are modifying is the device driver that you copied into your personal driver catalog. Press ENTER.
The Detail window appears again.
Under some operating environments, you may need to enter additional information using the Host Commands window. Select Tools from the menu bar of the Detail window to access the Host Commands window. Select Host Commands Window; the Host Commands window appears as shown in the following display.
Host Commands Window
The Host Commands window stores the host commands issued at driver initialization, before and after each display is produced, and at driver termination. These commands are typically used to send graphics output to a hardcopy device, such as a printer. You can specify multiple commands for each field. The available commands and their delimiters are host dependent. There are four fields in the Host Commands window:
The Driver Initialization field specifies the commands to issue each time the device driver is initialized.
The Pre-Graph commands field specifies the commands to issue before each display is produced.
The Post-Graph commands field specifies the commands to issue after each display is produced.
The Driver Termination field specifies the commands to issue each time the device driver terminates.
For more information on the Host Commands window and commands in specific operating environments, refer to the SAS companion documentation for your operating environment and the SAS companion documentation for your printer.
Select Close from the File menu to return to the Detail window from the Host Commands window.
Select File and Close twice from the Detail window, then select Goback to return to the WorkPlace menu.
Select Tasks Setup Environment Graphics options... Active graphics device...The Active Graphics Device window appears as shown in the following display.
Active Graphics Device Window
The Devices window appears with a list of the devices in your personal device catalog, as shown in the following display.
Devices Window
Select the desired driver; the Active Graphics Device window reappears.
You do not need to set up your device drivers every time you print a graphic. The graphics device that you select remains active until you change it, even when you exit your SAS session. However, to make sure the list of drivers in your personal device catalog is always displayed when you select an item that requests a driver, you need to have the GDEVICE0 libref assigned to your personal device catalog. You can assign the GDEVICE0 libref each time you use SAS/ASSIST software by selecting Assign libref from the Graphics Device Catalog Management window or you can assign the libref in your SAS autoexec file so the GDEVICE0 libref is assigned automatically each time you invoke SAS. For more information on assigning librefs in your SAS autoexec file, refer to the SAS companion documentation for your operating environment.
Modifying Graphics Device Defaults |
Depending on your display device (monitor) and hardcopy device (printer), you may need to select colors other than the default of blue to view and print your graphic. Follow these instructions to complete that function:
Follow this path to change the text and axes colors for a bar chart from the default of blue:Tasks Setup Environment Graphics options... Graphic defaults...The Graphics Defaults window appears as shown in the following display.
Graphics Defaults Window
Select Text color to display a list of valid colors for the text of your graph and select Axes color to display a list of valid colors for the axes of your graph. Select the color you prefer to change the text and axes color of your graph.
Select Font style to display a list of valid fonts for the text of your graph. Select the font you prefer to change the font style of your graph. If no font is specified, the hardware font of the graphics device is used.
Select Text size to display a list of valid heights for the text of your graph. Select the height you prefer to change the text size of your graph.
Type a value for HPOS and VPOS. HPOS specifies the number of columns in your graphics display area. VPOS specifies the number of rows in your graphics display area.
Select Rotate graph if you want to rotate the graph by 90 degrees.
These changes are reflected the next time you run a report.
Printing with Modified Drivers |
Select OK. The graphic prints using the modified driver that you copied, modified, and selected as the active printer device.
Select Close from the File menu to return to the previous window.
If a hardcopy device was selected along with a monitor, the graphic in the Graph window uses the hardcopy device (HP LaserJet Series IIIsi) parameters, not the display device parameters.
If you do not select a graphics device for Hardcopy device in the Active Graphics Device window, and you select Print from the File menu after the graphic appears in the Graph window, a window appears asking you to type your hardcopy device name.
Type the name of your device and select OK to print your graph.
If a hardcopy device was not selected, the graph in the Graph window uses the display device parameters, not the hardcopy device parameters.
If you only select a hardcopy device along with the Hardcopy item in the Active Graphics Device window, the graphic prints directly to the hardcopy device. The graphic does not appear in the Graph window, and your current window remains displayed. Printing directly to the printer is illustrated in the next section.
Printing Directly to the Printer |
Select Active graphics device... from the Graphics options... menu to print the graphic directly to the hardcopy device without displaying the graphic in the Graph window. The Active Graphics Device window appears.
The Devices window appears with a list of the devices in your personal device catalog.
Select the desired driver; the Active Graphics Device window reappears.
Select OK, then Run to print the graphic directly to the printer and remain at your current window.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.