GDEVICE Procedure

Device Catalogs

The DEVICES 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.
To specify the current catalog by:
  • use the CATALOG= option in the PROC GDEVICE statement (this is required to open a driver entry in Update mode)
  • assign the GDEVICE0 libref to the appropriate catalog

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 either of the following are true:
  • Any of the GDEVICE libraries do not contain a DEVICES catalog.
  • 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 reason, or 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.