Transporting and Converting Graphics Output


You can use the following methods to transport and convert graphics output within the SAS System:

  • Use the CPORT and CIMPORT procedures in base SAS software to transport catalogs that contain graphics output to other operating environments that are running the same version of SAS/GRAPH software.

  • Use a LIBNAME statement and the CATALOG procedure to convert catalogs from Version 6 to Version 7 or Version 8.

Transporting Catalogs across Operating Environments

Use the CPORT and CIMPORT procedures to transport catalogs and catalog entries from one machine to another machine running in a different operating environment. In addition to graphics output stored in GRSEG catalog entries, SAS/GRAPH software produces several other files that you can transport from host environment to host environment. These other files include

  • colors maps

  • templates

  • fonts

  • device descriptions.

To transport catalog entries that contain graphics output (catalog entries of type GRSEG), follow these steps:

  1. Use the CPORT procedure to create a transport file from the catalog entries in the current host environment. A transport file is a sequential file that contains the catalog in SAS transport format. To create a transport file, you must specify a catalog to be converted and a fileref for the transport file.

    To retain the original order of the GRSEG entries in the catalog, use SELECT= in the PROC CPORT statement to export individual graphs in the order they were created. Otherwise, when you use the GREPLAY procedure to list the graphics entries in the imported catalog, the procedure will list the entries in alphabetical order, rather than the order in which they were created.

    Note: Only the GREPLAY procedure can list catalog entries in the order they were created. All other procedures list entries in alphabetical order.

    To export a catalog that contains groups of entries created using the GREPLAY procedure, you must use SELECT= in the PROC CPORT statement to select the names of the groups, rather than the names of individual graphs, to be included in the transport file. If you export the entire catalog without using SELECT=, the groups are not maintained in the catalog created when you import the transport file in the new host environment.

    When you use the CPORT procedure, messages in the SAS log identify the catalog entries that have been placed in the transport file. If the catalog entry was created by replaying several graphs into a template, the log messages list the names of all of the entries that contributed to the templated graph.

  2. Move the transport file to the target machine, if necessary. You must move the transport file in binary format. If you do not move the transport file in binary format, the CIMPORT procedure cannot read the file you create.

    Operating Environment Information: Use communications software or tape to move the transport file. Refer to the documentation for your network or standard procedures for using tape files.

  3. Once you have moved the transport file to the target machine, import the transport file into a catalog in the new host environment using the CIMPORT procedure. The entries are imported in the order specified in SELECT= in the PROC CPORT statement used to create the transport file.

    The SELECT= option in the PROC CIMPORT statement does not affect the order of the imported entries.

Note: You must use the CIMPORT procedure from the current version of the SAS System. The CIMPORT procedure in a previous release cannot read a transport file created by the CPORT procedure in the current version. For details on using the CPORT and CIMPORT procedures, see the Base SAS Procedures Guide .

Example of Transporting GRSEGs

This example shows how to port three entries from the catalog MYLIB.GRAPHS.

First, the CPORT procedure writes selected graphs from MYLIB.GRAPHS to the transport file TRANFILE. The SELECT option names the graphs to be ported.

 libname mylib  SAS-data-library  ;  filename tranfile  external-file  ;  proc cport file=tranfile       catalog=mylib.graphs       select=(GPLOT.GRSEG, GPLOT1.GRSEG, GPLOT3.GRSEG);  run; 

Once the transport file has been moved to the new host environment using communications software or tape, the CIMPORT procedure creates a new catalog called MYLIB.GRAPHS on the new machine.

 libname mylib  SAS-data-library  ;  filename tranfile  external-file  ;  proc cimport catalog=mylib.graphs       infile=tranfile       select=(GPLOT.GRSEG, GPLOT1.GRSEG, GPLOT3.GRSEG);  run; 

Example of Transporting Color Maps and Templates

To transport color maps (catalog entries of type CMAP) and templates (catalog entries of type TEMPLATE) from one host environment to another, use the CPORT and CIMPORT procedures. For example, you could export a color map from the NEWLIB.CMAPS catalog using the following statements:

 filename tranfile  external-file  ;  libname newlib  SAS-data-library  ;  proc cport file=tranfile catalog=newlib.cmaps select=(mymap.cmap);  run; 

After moving the transport file to the new host environment, you can import the color map using the following statements:

 filename tranfile  external-file  ;  libname newlib  SAS-data-library  ;  proc cimport infile=tranfile catalog=newlib.cmaps;  run; 

Example of Transporting Fonts

To transport fonts (catalog entries of type FONT) from one operating system to another, use the CPORT and CIMPORT procedures. For example, you could export a font from the GFONT0.FONTS catalog using the following statements:

 filename tranfile  external-file  ;  libname gfont0  SAS-data-library  ;  proc cport file=tranfile       catalog=gfont0.fonts       select=(figures.font);  run; 

After moving the transport file to the new host environment, you can import the font using the following statements:

 filename tranfile  external-file  ;  libname gfont0  SAS-data-library  ;  proc cimport infile=tranfile catalog=gfont0.fonts;  run; 

Example of Transporting Device Attributes and Device Entries

To transport device entries (catalog entries of type DEV) from one operating environment to another, use the CPORT and CIMPORT procedures. For example, you could export a device entry from the GDEVICE0.DEVICES catalog using the following statements:

 filename tranfile  external-file  ;  libname gdevice0  SAS-data-library  ;  proc cport file=tranfile       catalog=gdevice0.devices       select=(cgm.dev);  run; 

After moving the transport file to the new host environment, you can import the device entry using the following statements:

 filename tranfile  external-file  ;  libname gdevice0  SAS-data-library  ;  proc cimport infile=tranfile catalog=gdevice0.devices;  run; 

Converting Catalogs to a Different Version of SAS

To convert catalogs to a different version of SAS, for example from Version 6 to Version 8, use the LIBNAME statement and the CATALOG procedure.

Note: You will not be able to use your old catalogs without transporting them first.

Before using PROC CATALOG, you must assign librefs to both catalogs and specify the Version 6 Compatibility Engine (saseb) on the input catalog libname. Then use PROC CATALOG with a COPY statement to convert a catalog from Version 6 to Version 7 or Version 8. For details on using the CATALOG procedure, see the Base SAS Procedures Guide .

For example, the following statements can be submitted from Version 8 to assign the Version 6 Compatibility Engine and convert a catalog from Version 6 to Version 8.

 libname v6lib saseb  SAS-data-library  ;  libname v8lib  SAS-data-library  ;  proc catalog catalog=v6lib.v6cat;     copy out=v8lib.v8cat;  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