Chapter Contents

Previous

Next
The GDEVICE Procedure

Concepts


About Device Catalogs

Device entries are stored in SAS catalogs that are named libref.DEVICES. Device entries for your operating environment that are supplied with SAS/GRAPH software are stored in the Institute-supplied catalog, SASHELP.DEVICES.

Custom device entries are typically stored in a catalog named GDEVICEn.DEVICES (where n can be any number from 0 to 9). However, device entries that have been created or modified by a system administrator specifically for your site also may be stored in SASHELP.DEVICES. (On multi-user systems, the SAS Support Consultant is usually the person who has write access to the SASHELP.DEVICES catalog and makes any changes.)

About the Current Catalog

When the GDEVICE procedure determines which catalog it should use, it searches for the catalog in the following order:

  1. the catalog name specified in the CATALOG= option in the PROC GDEVICE statement

  2. the catalog associated with the GDEVICE0 libref, if the libref has been assigned

  3. the Institute-supplied catalog, SASHELP.DEVICES. (SASHELP.DEVICES is usually write-protected and is opened in browse mode.)

The first catalog it finds becomes the current catalog.

You can specify the current catalog by


Search Order of Device Catalogs

When you specify a device driver, SAS/GRAPH software looks only into catalogs with certain librefs and names to find a device entry for that driver. It searches these catalogs sequentially in the following order:

  1. If the libref GDEVICE0 has been assigned to a SAS library, SAS/GRAPH software looks in that library for a catalog named DEVICES. If the GDEVICE0.DEVICES catalog exists, it is checked for the specified device entry. If the device entry is not there, SAS/GRAPH software looks next for a library with the libref GDEVICE1 and for a catalog named DEVICES in that library. The search is repeated for the sequence of librefs through GDEVICE9.

  2. If SAS/GRAPH fails to find the specified device entry in any DEVICES catalog in the libraries GDEVICE0 through GDEVICE9, or if before locating the specified device entry it encounters in that sequence an undefined libref or a library that does not contain a DEVICES catalog, it jumps to SASHELP.DEVICES to search for the device entry. For example, if a GDEVICE0 libref is allocated but this library does not contain a DEVICES catalog, SAS/GRAPH software jumps to the SASHELP.DEVICES catalog, without searching for a GDEVICE1.DEVICES catalog, even if it exists. (SASHELP.DEVICES is the device catalog supplied with SAS/GRAPH software. SASHELP is one of the standard librefs defined automatically whenever you start your SAS session; you do not need to issue a LIBNAME statement to define it.)

  3. If the specified device entry is not found in the SASHELP.DEVICES catalog, you receive an error message.

Since the GDEVICE0.DEVICES catalog is the first place that SAS/GRAPH software looks, you always should assign that libref to the library containing your personal catalog of device entries, if you have one. If for some reason you have personal device catalogs in more than one SAS data library, assign them librefs in the sequence GDEVICE0, GDEVICE1, GDEVICE2, and so on.

Note:   As stated above, the search for entries terminates if there is a break in the sequence; the catalog GDEVICE1.DEVICES is not checked if the libref GDEVICE0 is undefined, or if GDEVICE0 does not contain a catalog named DEVICES.  [cautionend]

To cancel or redefine the libref GDEVICEn, first clear the current graphics options:

goptions reset=all;

You can then redefine the libref with another LIBNAME statement. To cancel a libref, use a null LIBNAME statement.


Ways to Use the GDEVICE Procedure

There are two ways to use the GDEVICE procedure:

If you run SAS software in a windowing environment (the SAS Display Manager System, for example), you can use either the GDEVICE procedure windows or the GDEVICE procedure statements. In a windowing environment, the GDEVICE procedure automatically opens the GDEVICE procedure windows.

If you run SAS software in a non-windowing environment (such as line-mode or batch), you can use only GDEVICE procedure statements. In a non-windowing environment, the GDEVICE procedure automatically uses program mode.

Both methods provide identical functionality and allow you to display or modify device parameters, or create new device entries.

Windowing Mode

In a windowing environment, open the GDEVICE windows by submitting the PROC GDEVICE statement without the NOFS option:

proc gdevice;

This opens the DIRECTORY window in browse mode. This window lists all of the device entries in the current catalog. (See About the Current Catalog.)

To open the DIRECTORY window in edit mode, or to specify a different catalog, include the CATALOG= option in the PROC GDEVICE statement.

From the DIRECTORY window you can select the device entry you want to work with and open other GDEVICE windows in which you can view or modify device parameters. For more information, see Using the GDEVICE Windows.

In a windowing environment, you can switch between the GDEVICE windows and program statements while you are running the procedure. See the FS Statement and the NOFS window command in the SAS Help facility for SAS/GRAPH.

To exit the GDEVICE windows, submit the End command or close the window.

Program Mode

If you are in a non-windowing or batch environment, the GDEVICE procedure automatically starts in program mode. If you are in a windowing environment, specify the NOFS option to start the GDEVICE procedure in program mode:

proc gdevice nofs;

By default, the GDEVICE procedure accesses the current catalog in browse mode and prompts you in the LOG to enter additional program statements. (See About the Current Catalog.) To specify the current catalog, include the CATALOG= option in the PROC GDEVICE statement.

Once you start the GDEVICE procedure, you can enter and run additional statements without re-entering the PROC GDEVICE statement. For example, the following statement generates a listing of the device parameters for the PSCOLOR device entry that is stored in the Institute-supplied catalog, SASHELP.DEVICES:

list pscolor;

PROC GDEVICE procedure output is displayed in the Output window. Sample Device Entry Listing Generated in Program Mode shows the listing generated by the LIST statement.

Sample Device Entry Listing Generated in Program Mode
                             GDEVICE procedure
                Listing from SASHELP.DEVICES - Entry PSCOLOR

  Orig Driver: PSCOLOR            Module:   SASGDPSL  Model:     1251
  Description: PostScript color--RGB color defs            Type: PRINTER
  *** Institute-supplied ***
  Lrows:   0  Xmax:   8.500 IN    Hsize:    8.000 IN  Xpixels:       2550
  Lcols:   0  Ymax:  11.000 IN    Vsize:    8.500 IN  Ypixels:       3300
  Prows:  68                      Horigin:  0.218 IN
  Pcols:  80                      Vorigin:  1.496 IN
  Aspect:   0.000                 Rotate:
  Driver query: Y                 Queued messages: N
                                  Paperfeed:   0.000 IN

  OPTIONS

  Erase:                   Autofeed:      Y         Chartype:    1
  Swap:                    Cell:                    Maxcolors: 256
  Autocopy:                Characters:              Repaint:     0
  Handshake:     XONXOFF   Circlearc:               Gcopies:     0
                           Dash:                    Gsize:       0
  Prompt - startup:        Fill:                    Speed:       0
         end graph:        Piefill:                 Fillinc:     0
         mount pen:        Polyfill:                Maxpoly:  1450
         chg paper:        Symbol:                  Lfactor:     0
                           Pensort:       N
  Promptchars:  '000A010D05000000'X
  Devopts:      'FD9230402C130000'X
  UCC:      '0001'X

  Cback:      WHITE
  Color list:

    BLACK     RED       GREEN     BLUE      CYAN
    MAGENTA   YELLOW    GRAY

  CHARTYPE RECORDS

  Chartype Rows  Cols                  Font Name                 Scalable
       1     89    85   Courier                                      Y
       2     89    85   Courier-Oblique                              Y
       .
       {ob ...more hardware fonts...}
       .
      34     89    85   Bookman-LightItalic                          Y
      35     89    85   Bookman-DemiItalic                           Y
  Gend:     '0A'X

  FILE INFORMATION

  Gaccess:    sasgastd>sasgraph.ps
  Gsfname:                        Gsfmode:  PORT      Gsflen:       0
  Trantab:                        Devmap:
  Devtype:    DISK
  Gprotocol:
  Fileclose:  DRIVERTERM
  Hostspec:

  HOST INFORMATION

You can exit the GDEVICE procedure in these three ways:


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.