Selecting a Device Driver


Although SAS/GRAPH software usually selects an appropriate device driver for displaying graphics output on your display device, you may need to select a different device driver if you want to direct your graphics output to another destination.

When you select a device driver, it must be one that is appropriate for your device. The device driver must

  • send commands to the device that the device understands. For example, if you are using an X Windows display, the SAS/GRAPH device driver sends the appropriate data stream that can produce graphics output on the display device.

  • contain values of device parameters that are appropriate for the device. For example, if you are using a color PostScript printer and you select a device driver for a black and white PostScript printer, your graph will not print in color .

Occasionally the device driver you use is not the one that bears your device s name . This can happen when

  • your graphics device uses a common graphics language (for example, PostScript).

  • your graphics device emulates a different graphics device. (For example, there is no SAS device driver for your plotter, but the plotter can be set up to emulate a Hewlett-Packard 7550 plotter.)

In this case, you use the device driver that matches the language that your device understands. For example, if your Hewlett-Packard LaserJet II printer has a PostScript card installed, you would use one of the PostScript device drivers rather than HPLJS2. Similarly, you could use an HP driver for a plotter (for example, HP7550A) when your plotter emulates a Hewlett-Packard 7550 plotter.

You cannot force a device to act as a device with different capabilities by choosing a different device driver.

Viewing the List of Available Device Drivers

You can view the list of device entries in SASHELP.DEVICES or in any other device catalog in the following ways:

  • use the SAS Explorer window to display the contents of the device catalog.

  • use the GDEVICE procedure to open the GDEVICE DIRECTORY window, which lists all of the device drivers in the current catalog. By default the current catalog is SASHELP.DEVICES. To specify a catalog, include the CATALOG= option, as shown in the following statement:

     proc gdevice catalog=sashelp.devices; 

    See Using the GDEVICE Windows on page 928 for details.

  • use GDEVICE procedure statements to write the list of device drivers to the Output window:

     proc gdevice catalog=sashelp.devices nofs;    list;  run;  quit; 

    The NOFS on page 921 option in the PROC GDEVICE statement causes the procedure not to use the GDEVICE windows.

    If you want to write the list of devices to an external file you can

    • save the contents of the Output window.

    • use the PRINTTO procedure to redirect the GDEVICE procedure output to an external file. See Base SAS Procedures Guide for a description of the PRINTTO procedure.

Once you have generated the list of available device drivers, you can search the list until you find the description that matches your output device. The corresponding name is the name that you specify as the device driver.

Browsing the Contents of a Device Entry

You can also use any of the viewing methods to browse the contents of a device entry. From the GDEVICE Directory window, select the device name to open the GDEVICE Detail window. From there you can move to the other GDEVICE windows for the entry, using either the menus or commands. For details, see Using the GDEVICE Windows on page 928.

You can display the contents of a device entry in the Output window by selecting the entry from the Explorer window or by submitting GDEVICE statements. The following statements list in the Output window the contents of the PSCOLOR device entry:

 proc gdevice c=sashelp.devices nofs;     list pscolor;  run;  quit; 

See Output 31.1 for an illustration of the device listing.

Specifying a Device Driver in a SAS Session

You can specify a device driver in these ways:

  • use the DEVICE= option in a GOPTIONS or OPTIONS statement. For example,

     goptions device=pslepf; 

    For details, see GOPTIONS Statement on page 146.

  • change the device in the System Options window. To do so, type the OPTIONS command on the command line, and in the Graphics group , choose "Driver settings." You can then enter a Device value. Use the window s Help button if you need help editing values.

  • enter the device name in the DEVICE prompt window. The DEVICE prompt window opens automatically if you submit a SAS/GRAPH program that produces graphics output, no device has been specified, and you are running outside of the SAS windowing system environment.

If you specify a device driver in more than one way, the most recently specified device driver is used. The device driver stays in effect until you specify another device, submit the graphics option RESET=GOPTIONS or RESET=ALL, or end your SAS session.

If you use the same device driver for most or all of your SAS/GRAPH programs, you can put the GOPTIONS DEVICE= statement in an AUTOEXEC file. See the SAS companion for your operating environment for details on setting up an AUTOEXEC file.

You can also specify a device for previewing or printing your output with the TARGETDEVICE= graphics option. For details, see Printing Graphics Output on page 51.




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