Chapter Contents

Previous

Next
Moving and Accessing SAS Files across Operating Environments

Importing a Transport File That Contains Member Type CATALOG

You can use only PROC CIMPORT to import a transport file of member type CATALOG. You must use PROC CIMPORT at the target host when PROC CPORT was used at the source host to create the transport file.


Using Compatible Destination Member Types in PROC CPORT and PROC CIMPORT

Make sure that you use destination member types in PROC CPORT and PROC CIMPORT that are compatible.

For statements used at source host: At the target host, you are limited to:
CPORT LIBNAME= CIMPORT LIBNAME= or DATA=
CPORT DATA= CIMPORT LIBNAME= or DATA=
CPORT CATALOG= CIMPORT LIBNAME= or CATALOG=

If destination members are incompatible, you receive either an error or warning message. See Preventing and Fixing Problems for recovery actions for common error messages. For complete details about PROC CPORT and PROC CIMPORT syntax, see SAS Procedures Guide.


Using PROC CIMPORT to Import Multiple Catalogs from a Transport File

This example uses the CIMPORT procedure to import multiple catalogs from a transport file.

filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin library=target memtype=catalog;
run;

To import multiple catalogs, specify the LIBRARY= option and MEMTYPE=CATALOG in PROC CIMPORT.

In the preceding example, the fileref IMPORTIN points to the location where the transport file was transferred to the target host. The libref TARGET points to a new location where the transport file will be copied. The PROC CIMPORT statement copies as its source the file that is identified in the INFILE= option to the location identified in the LIBRARY= option. Because the destination is a library, only the libref is specified. The MEMTYPE= option restricts the import to catalogs. PROC CIMPORT implicitly translates the transport file into the target host native format.


Using PROC CIMPORT to Import an Entire Catalog from a Transport File

This example uses the CIMPORT procedure to import an entire catalog from a transport file.

filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin catalog=target.testcat;
run;

To import a single catalog, specify the CATALOG= option in PROC CIMPORT.


Using PROC CIMPORT to Import a Specific Catalog Entry Type from a Transport File

This example uses the CIMPORT procedure to import a specific catalog entry type from a transport file.

filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin catalog=target.testcat et=list;
run;

To import a single entry type in a catalog, specify the ET= option in PROC CIMPORT. Also, the CATALOG= option in PROC CIMPORT must be specified.


Using PROC CIMPORT to Import Selected Catalog Entries from a Transport File

This example uses the CIMPORT procedure to import selected catalog entries from a transport file.

filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin catalog=target.testcat;
 select testnpgm.list one.scl;
run;

The SELECT option specifies the catalog entries that you want by name. In this example, SELECT TESTNPGM.LIST ONE.SCL explicitly names the selected catalog entries. Also, the CATALOG= option in PROC CIMPORT must be specified.

As an alternative, you can use the EXCLUDE statement in PROC CIMPORT to omit explicitly catalog entries that you do not want.


Chapter Contents

Previous

Next

Top of Page

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