Chapter Contents

Previous

Next
Moving and Accessing SAS Files across Operating Environments

Templates for Restoring a Transport File

You use either of two traditional methods for restoring a transport file:

Here is the syntax template for the XPORT engine and PROC COPY:

[1] LIBNAME libref XPORT 'transport-file';
[2] LIBNAME new-libref 'SAS-data-library';
[3] PROC COPY IN=libref OUT=new-libref;
[4] RUN;

  1. Use a LIBNAME statement to define the physical location of the transport file that was transferred to the target host.

    Note:   The transport-file argument that is specified in the LIBNAME statement that includes the XPORT engine is the file from which the transport formatted data is read. If the transport file is not being read from the current directory, be sure to specify the full physical name that is recognized by the operating environment. For details, see the appropriate companion for the operating environment. Examples of the LIBNAME statement with the XPORT engine throughout this document assume the current directory.   [cautionend]

  2. Use a LIBNAME statement to define a physical location in which to store the file to be restored in the target host's native format.

    The base engine is used by default.

  3. Use PROC COPY to read in the transport file and to write out its content in the target host native format.

  4. Use the RUN statement to execute the SAS statements.

Here is the syntax template for PROC CIMPORT:

[1] FILENAME fileref 'transport-file';
[2] LIBNAME libref 'SAS-data-library';
[3] PROC CIMPORT INFILE=fileref LIBRARY=libref ;
[4] RUN;

  1. Use a FILENAME statement to define a physical location for the transport file that was transferred to the target host.

    Note:   The transport-file argument that is specified in the FILENAME statement is the file from which the transport formatted data is read.  [cautionend]

  2. Use a LIBNAME statement to define the physical location in which to store the file to be imported into the target host native format.

  3. Use PROC CIMPORT to read in the transport file and to write out its content in the target host native format.

    Note:   You can specify either LIBRARY= libref or CATALOG=libref.member, as appropriate.  [cautionend]

  4. Use the RUN statement to execute the SAS statements.

Because LIBNAME statement syntax is host-specific, we use the variables SAS-data-library and transport-file to represent a disk location. However, to specify the format of a magnetic medium, see Part 5 for host-specific details. Also, see the appropriate operating environment companion for complete details about the syntax of the LIBNAME statement.

For complete details about the syntax for SAS statements that you must use to create a transport file, see SAS Language Reference: Dictionary. For PROC statements, see SAS Procedures Guide.


Chapter Contents

Previous

Next

Top of Page

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