Restoring Transport Files at the Target Machine


Identifying the Content of the Transport File

If the person who restores the transport file at the target operating environment is different from the person who creates the transport file at the source operating environment, make sure you obtain information about the transport file in advance of the file restore operation. Here is an example of the type of information that might be useful for restoring the transport file to native format at the target operating environment:

Table 3.1: 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

PROC CPORT

TPORT.DAT

TEST.CITY

TEST.FORMATS

REGFMT

SAS 9

   

TEST.CLASS

 

SALEFMT

         

SIZEFMT

You can find out which strategy was used to create the transport file by using a text editor or by using 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 "Using File Headers to Identify Which Strategy Was Used to Create a Transport File" on page 62.

Also, you can use these 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 .

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 operating environment. 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 operating environment 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 only 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 operating environment. 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 operating environment native format.

The SELECT statement selects only the data set GRADES for the library TARGET.

Using PROC CIMPORT to Import Catalogs From a Transport File

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.

For statements at the source operating environment, use:

For statements at the target operating environment, 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 a warning message. See Chapter 12, "Preventing and Fixing Problems," on page 67 for recovery actions that can be taken to fix common errors. For complete details about PROC CPORT and PROC CIMPORT syntax, see the Base 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. 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 operating environment. 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 operating environment native format.

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; 

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; 

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.




Moving and Accessing SAS 9.1 Files
Moving And Accessing SAS 9.1 Files
ISBN: 1590472306
EAN: 2147483647
Year: 2004
Pages: 109
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net