Proc Cport/Cimport (Transferring Data)
Proc Cport and Cimport compress an entire directory of SAS savesets
into one transport file. SAS transport files are platform independent,
making your SAS datasets easy to transfer or e-mail to others. To
compress all the SAS savesets in C:\data, run the following program.
Libname local 'C:\data';
Filename example 'C:\data\sasdata.xpt';
Proc Cport File=example Library=local;
Run;
To de-compress a SAS transport file into C:\data, run the following
program.
Libname local 'C:\data';
Filename example 'C:\data\sasdata.xpt';
Proc Cimport Library=local Infile=example;
Run;
If Cimport does not work, the transport file may have been created
with Proc Copy. To read a transport file created with Proc Copy, run
the following program.
Libname local 'C:\data';
Libname example2 xport 'C:\data\sasdata.xpt';
Proc Copy In=example2 Out=local; Run;
If both Cimport and Copy fail to open the transport file, the file
is either corrupted or not a SAS transport file. Be sure to use a
binary format when transferring transport files.
|