Restoring Transport Files at the Target Computer

Verifying the Content of the Transport File

Obtain information about the transport file in advance of the file restore operation when the person who restores the transport file at the target computer is different from the person who creates the transport file at the source computer. Here is an example of the type of information that might be useful for restoring the transport file to native format at the target computer:
Description of Transport File
Type of Source Operating Environment and SAS Release Used
Strategy Used to Create Transport File
Transport Filename
Data Sets
Catalogs
Catalog Entries
z/OS
SAS 9
PROC CPORT
TPORT.DAT
TEST.CITY
TEST.CLASS
TEST.FORMATS
REGFMT
SALEFMT
SIZEFMT
You can find out the strategy that was used to create the transport file by using a text editor. You can also use an operating environment read or view command to read the transport file. The XPORT engine and PROC CPORT create transport files whose headers look different. For details, see File Headers: Finding Out the Method Used to Create the Transport File.
Also, you can use these SAS procedures to list the contents of the transport file: PROC CATALOG, PROC CONTENTS, and PROC DATASETS. For details about these procedures, see the Base SAS Procedures Guide.

Restore the Transport File Using PROC CIMPORT

Example: Using PROC CIMPORT to Import Data Sets from a Transport File

This example uses the CIMPORT procedure to import multiple data sets from a transport file.
filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin library=target memtype=data;
run;
In the preceding example, the fileref IMPORTIN points to the location where the transport file was transferred to the target computer. 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. The PROC CIMPORT statement implicitly translates the transport file into the target computer native format.
Because the LIBRARY= option permits both data sets and catalogs to be copied to the library, you need to specify MEMTYPE=DATA to restrict the operation to data sets in the library. Omitting the MEMTYPE= option permits both data sets and catalogs, in the file referenced by the fileref IMPORTIN, to be copied to the location referenced by the libref TARGET.
In order to subset the destination member in PROC CIMPORT, use either the SELECT statement, the EXCLUDE statement, or the MEMTYPE= option. Here is an example of subsetting:
filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin library=target memtype=data;
  select grades;
run;
In the preceding example, the libref TARGET and the MEMTYPE= option point to the new location where the transport file will be copied. The fileref IMPORTIN points to the location where the transport file was transferred to the target computer. 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. The PROC CIMPORT statement implicitly translates the transport file into the target computer native format.
The SELECT statement selects only the data set GRADES for the library TARGET.

Using Compatible Destination Member Types in PROC CPORT and PROC CIMPORT

To import catalogs from a transport file, make sure that you use compatible destination member types in PROC CPORT and PROC CIMPORT as shown in the following table.
Supported Statements at the Source Computer
Supported Statements at the Target Computer
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 a warning message. See Preventing and Fixing Problems for recovery actions that can be taken to fix common errors. For details about PROC CPORT and PROC CIMPORT syntax, see the Base SAS Procedures Guide.

Example: 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. To import multiple catalogs, specify the LIBRARY= option and MEMTYPE=CATALOG in PROC CIMPORT.
filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin library=target memtype=catalog;
run;
In the preceding example, the fileref IMPORTIN points to the location where the transport file was transferred to the target computer. 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 computer native format.

Example: Using PROC CIMPORT to Import a Single Catalog from a Transport File

This example uses the CIMPORT procedure to import a single catalog from a transport file. To import a single catalog, specify the CATALOG= option in PROC CIMPORT.
filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin catalog=target.testcat;
run;

Example: Using PROC CIMPORT to Import a Single Catalog Entry Type from a Transport File

This example uses the CIMPORT procedure to import a single catalog entry type from a transport file. To import a single catalog entry type, specify the ET= option and the CATALOG= option in PROC CIMPORT.
filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin catalog=target.testcat et=list;
run;

Example: 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. Use a SELECT statement to specify the names of the catalog entries that you want. In this example, SELECT TESTNPGM.LIST ONE.SCL explicitly names the selected catalog entries. Also, the CATALOG= option in PROC CIMPORT must be specified.
filename importin 'transport-file';
libname target 'SAS-data-library';
proc cimport infile=importin catalog=target.testcat;
 select testnpgm.list one.scl;
run;
As an alternative, you can use the EXCLUDE statement in PROC CIMPORT to omit explicitly catalog entries that you do not want.