Previous Page | Next Page

The GDEVICE Procedure


Device Catalogs

Device entries are stored in SAS catalogs that are named libref.DEVICES. Device entries for your operating environment that SAS supplies with SAS/GRAPH software are stored in the 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 might be stored in SASHELP.DEVICES. (On multi-user systems, the administrator is usually the person who has write access to the SASHELP.DEVICES catalog.)

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 catalog SAS supplies, SASHELP.DEVICES. (SASHELP.DEVICES is usually write-protected and is opened in browse mode.)

The first catalog SAS encounters is the current catalog.

Specify the current catalog by;

Search Order of Device Catalogs

SAS/GRAPH searches only librefs starting with GDEVICE0 through GDEVICE9. The libraries must contain a catalog named DEVICES for SAS/GRAPH to search for the device entries for any driver. If you have personal device catalogs in more than one SAS library, you must assign librefs in the sequence GDEVICE0, GDEVICE1, GDEVICE2, and so on.

If the libref GDEVICE0 has been assigned to a SAS library, SAS/GRAPH 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 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.

The search terminates if:

  1. any of the GDEVICE libraries do not contain a DEVICES catalog

  2. the librefs do not follow the numeric sequence of GEVICE0, GDEVICE1, GDEVICE2, and so on, in that order.

If SAS/GRAPH terminates the search for either reasons, or it it does not find the specified device entry, SAS/GRAPH searches the SASHELP.DEVICES catalog.If the specified device entry is not found in the SASHELP.DEVICES catalog, an error message is written to the log.

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

Ways to Use the GDEVICE Procedure

There are two ways to use the GDEVICE procedure:

If you run SAS in a windowing environment, 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 in line mode or batch mode, you can use only GDEVICE procedure statements. In a non-windowing environment, the GDEVICE procedure automatically uses line mode.

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

Running the GDEVICE Procedure In A Windowing Environment

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 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 that 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 FS Statement and the NOFS option in PROC GDEVICE Statement.

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

Running the GDEVICE Procedure In 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 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 resubmitting the PROC GDEVICE statement. You can exit the GDEVICE procedure in these three ways:

PROC GDEVICE procedure output is displayed in the Output window.

Previous Page | Next Page | Top of Page