In SAS, how do I create a transport data set file?
A SAS transport data set file is a machine-independent file that allows you to move a SAS data set from one operating system to another. You can directly read a SAS transport data set file with several statistical software packages (e.g., SPSS, BMDP).
Following is an example of SAS code to copy the SAS data set file
job1.sas7bdat to a SAS transport data set file
portable.xpt in the outdata directory:
In the example above:
- The first
LIBNAMEstatement aliases the library reference (libref)miscto theworkdirectory.
- The second
LIBNAMEstatement aliases the librefsasxptwith the physical name of a SAS transport format file (in this case,portable.xptin theoutdatadirectory).
- The
COPYprocedure copies one or more SAS data sets in theIN=libref (in this case,misc) to theOUT=libref (in this case,sasxpt).
- The
SELECTstatement specifies that only the filejob1.sas7bdatshould be included in the transport fileportable.xpt.
The file and pathnames in the above example follow Unix
conventions. If you use SAS for Windows, follow the appropriate
filename and pathname conventions. For example, in SAS for Windows,
the two LIBNAME statements in the above example would
instead be:
You can find more information on running SAS for Windows with the Stat/Math Center's Getting Started with SAS for Windows. For more information on running SAS in Unix, see the Stat/Math Center's Getting Started with SAS for UNIX.
For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.
Last modified on January 24, 2011.







