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 4.1: Description of Transport File

Type of Source Operating Environment and SAS Release Used

Strategy Used to Create Transport File

Transport Filename

Data Sets

z/OS

XPORT Engine

TPORT.DAT

TEST.CITY

SAS 9

   

TEST.CLASS

You can find out which strategy was used to create the transport file by examining the file header. 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 PROC CONTENTS and PROC DATASETS to list the contents of the transport file. For details about these procedures, see the Base SAS Procedures Guide .

Using a DATA Step to Restore a Single Data Set From a Transport File

This example uses the DATA step to restore a data set from a transport file.

 libname xportin xport '  transport-file  '; libname target '  SAS-data-library  '; data target.grades;    set xportin.grades; run; 

In the preceding example, the libref XPORTIN points to the location of the exported data set that was transferred to the target operating environment. The XPORT engine specifies that the data set is to be read in transport format. The libref TARGET points to a new location where the translated file will be copied . The SET statement reads the data set XPORTIN.GRADES in transport format and translates it and copies it to the location specified in the DATA statement. Because a DATA step with the XPORT engine was used at the source operating environment to create the transport file for a single data set, only a data set can be restored at the target operating environment.

Using PROC COPY to Restore Data Sets From a Transport File

This example uses the COPY procedure to restore one or more data sets from a transport file.

 libname xportin xport '  transport-file  '; libname target '  SAS-data-library  '; proc copy in=xportin out=target;   select grades; run; 

In the preceding example, the libref XPORTIN points to the location where the transport file was transferred to the target operating environment. The XPORT engine in this LIBNAME statement specifies that the transport file at this location is to be read in transport format. The libref TARGET points to a new location where the transport file will be copied in native format. The PROC COPY statement copies the selected data set GRADES from the library that is identified in the IN= option to the new library that is identified in the OUT= option.

Using a SELECT statement, you specify one or more specific data sets to be copied to the new library. To specify that all data sets in the transport file be copied, omit the SELECT statement from PROC COPY.

Note  

You can use the EXCLUDE statement in PROC COPY to omit explicitly the data sets that you do not want instead of using the SELECT statement to specify the data sets that you 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