Chapter Contents

Previous

Next
The CPORT Procedure

Overview

The CPORT procedure writes SAS data sets, SAS catalogs, or SAS data libraries to sequential file formats (transport files). Use PROC CPORT with the CIMPORT procedure to move files from one environment to another. Transport files are sequential files that each contain a SAS data library, a SAS catalog, or a SAS data set in transport format. The transport format that PROC CPORT writes is the same for all environments and for many releases of the SAS System. In PROC CPORT, export means to put a SAS data library, a SAS catalog, or a SAS data set into transport format. PROC CPORT exports catalogs and data sets, either singly or as a SAS data library. PROC CIMPORT restores (imports) the transport file to its original form as a SAS catalog, SAS data set, or SAS data library.

Only PROC CIMPORT can read the transport files that PROC CPORT creates. For information on the transport files that the transport engine creates, see the section on SAS files in SAS Language Reference: Concepts.

PROC CPORT also converts SAS files, which means that it changes the format of a SAS file from the format appropriate for one version of the SAS System to the format appropriate for another version. For example, you can use PROC CPORT and PROC CIMPORT to move files from earlier releases of the SAS System to more recent releases. In such cases, PROC CIMPORT automatically converts the contents of the transport file as it imports it.

PROC CPORT produces no output (other than the transport files), but it does write notes to the SAS log.

To export and import files, follow these steps:

  1. Use PROC CPORT to export the SAS files that you want to transport.

  2. If you are changing operating environments, move the transport file to the new machine by using either communications software or a magnetic medium.

    Note:   If you use communications software to move the transport file, be sure that it treats the transport file as a binary file and that it modifies neither the attributes nor the contents of the file.  [cautionend]

  3. Use PROC CIMPORT to translate the transport file into the format appropriate for the new operating environment or release.


Chapter Contents

Previous

Next

Top of Page

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