PROBLEM:
How do I make a transport file using PROC COPY? Once this is done,
how do I unravel it again into a true SAS Data Set?
NOTE: for more general instructions for SAS Transport Files,
see the overview document at:
http://www.usc.edu/its/doc/statistics/sas/sastransport/
******************************************************************************
SOLUTION:
There is one basic procedure to perform these tasks. However, because
there are numerous different platforms that SAS operates under, small
differences do arise every now and then. What follows are two
examples of the same procedure on each of two different platforms:
UNIX and Windows.
Note 1: This PROC COPY method of making a transport file should be
used only when necessary. PROC CPORT (see explanation elsewhere in
this WWWeb page menu) should be used if possible. The following situations
are examples of when PROC COPY must be used:
- when re-converting a transport file originally made with PROC COPY
- when transporting a Version 5 SAS Data Set
- when transporting a file from a Release higher than 6.06 down to
a lower release
NOTE 2: SAS transport files must be sent in binary mode. When moving
files using ftp, make sure the 'binary' choice is checked (usually
a radio button or check-box) before transferring the file.
If using command-line ftp, issue the command 'binary' before
sending.
UNIX
----
1. Creating a PROC COPY transport file.
options replace; * Needed for 6.09 under
UNIX;
libname olddata '~/username'; * This is where the
SAS data sets are;
libname plum xport '~/sending.dta'; * This is what the
transport file is called;
proc copy in=olddata out=plum;
select orange grape;
2. Unraveling a PROC COPY transport file.
libname olddata '~/sasdata'; * SAS Data Sets will be
written here;
libname pear xport '~/incoming.data'; * This is what the
transport file is called;
proc copy in=pear out=olddata;
select peach guava;
Windows
-------
1. Creating a transport file
libname olddata 'c:\sasdata'; * This is the location
of the SAS data sets;
libname plum xport 'a:sending.dta'; * This is what the
transport file is called;
proc copy in=olddata out=plum;
select orange grape;
2. Unraveling a transport file
libname olddata 'c:\sasdata'; * New SAS Data Sets
will be written here;
libname pear sasv5xpt 'a:incoming.dta'; * This is what the
transport file is called;
proc copy in=pear out=olddata;
select peach guava;