Examples


The following examples illustrate major features of the GDEVICE procedure.

Example 1: Creating a Custom Device Entry with Program Statements

Procedure features:

  • COPY statement

  • MODIFY statement

Other features:

  • PROC GTESTIT

Sample library member: GDVCSTOM

click to expand

This example shows how to use GDEVICE procedure statements to modify a device entry by copying the original entry into a personal catalog and changing the device parameters. You can submit these statements one at a time or together.

This example permanently changes the default colors list for the PSCOLOR device entry. The contents of the original PSCOLOR entry are shown in Output 31.1. The new device entry is illustrated in the PROC GTESTIT output above.

Assign the libref GDEVICE0. The LIBNAME statement assigns the libref to the aggregate file storage location that contains (or will contain) the DEVICES catalog.

 libname gdevice0 '  SAS-data-library  '; 

Start the GDEVICE procedure. NOFS causes GDEVICE to use program mode. CATALOG= assigns GDEVICE0.DEVICES as the current catalog. If the DEVICES catalog does not already exist in the library, it is automatically created.

 proc gdevice nofs catalog=gdevice0.devices; 

Copy the original device entry from SASHELP.DEVICES to the current catalog. NEWNAME= specifies a name for the copy of PSCOLOR that is placed in GDEVICE0.DEVICES. The name of a catalog entry cannot exceed eight characters .

 copy pscolor from=sashelp.devices newname=mypscol; 

Modify the new entry. DESCRIPTION= specifies a new device description that appears in the catalog listing. COLORS= defines a new colors list.

 modify mypscol    description='PSCOLOR with new colors list'    colors=(black blue green red gray cyan           lime lipk); 

Exit the procedure.

 quit; 

Test the new device entry. The TARGET= graphics option specifies the new device. Since GDEVICE0 is already defined, SAS/GRAPH looks first in that catalog for the specified device entry. The GTESTIT procedure produces a test picture that show the new colors list and a listing in the LOG.

 goptions target=mypscol;  proc gtestit pic=1;  run; 



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