Chapter Contents

Previous

Next
Moving and Accessing SAS Files across Operating Environments

Templates for Creating a Transport File

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

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

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

  1. Use a LIBNAME statement to define the physical location of the source file in native format for which you are creating the transport file.

    The base engine is assumed, by default.

  2. Use a LIBNAME statement to define a physical location to store the transport file that is created.

    Note:   The transport-file argument that is specified in the LIBNAME statement that contains the XPORT engine is the file to which the transport data is written. If the transport file is not being written to 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]

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

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

Here is the syntax template for PROC CPORT:

[1] LIBNAME libref 'SAS-data-library';
[2] FILENAME fileref 'transport-file';
[3] PROC CPORT DATA=libref.member FILE=fileref;
[4] RUN;

  1. Use a LIBNAME statement to define the physical location of the source file in native format for which you are creating the transport file.

    The base engine is assumed, by default.

  2. Use a FILENAME statement to define a physical location to store the transport file that is created.

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

    Note:   For Releases 6.11 through Version 8, the FILENAME statement includes the FTP option that allows you to implicitly transfer the transport file directly to the target host. Using the FILENAME statement with the FTP option makes an explicit invocation of the FTP utility unnecessary. However, the examples in this chapter do not include the FTP option with the FILENAME statement. This chapter assumes an explicit invocation of the FTP utility. For an example of using the FTP option with the FILENAME statement, see OS/390 TSO to UNIX File Transport.  [cautionend]

  3. Use PROC CPORT to read the source file from native format and to write its content in transport format.

    Note:   You can specify member types other than DATA.  [cautionend]

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

Because LIBNAME statement syntax is host-specific, we use the variable SAS-data-library and transport-file to represent a disk location. However, to specify a magnetic medium format, 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 which 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.