In SAS, how do I create a transport data set file?
SAS transport data set files are machine-independent files that let you move SAS data sets between computers running different operating systems. You can directly read SAS transport data set files with several statistical software packages (e.g., SPSS and BMDP).
Following is sample SAS code that copies an SAS data set file
job1.sas7bdat) to an SAS transport data set file
LIBNAME misc '~/work'; LIBNAME sasxpt XPORT '~/outdata/portable.xpt'; PROC COPY IN=misc OUT=sasxpt; SELECT job1; RUN;
In the example above:
- The first
LIBNAMEstatement aliases the library reference (libref)
- The second
LIBNAMEstatement aliases the libref
sasxptwith the physical name of the SAS transport format file (
COPYprocedure copies one or more SAS data sets in the
IN=libref (in this case,
misc) to the
OUT=libref (in this case,
SELECTstatement specifies that only the file
job1.sas7bdatshould be included in the transport file
Note: The filenames and pathnames in the above
example follow Unix conventions. If you use SAS for
Windows, use the appropriate Windows filename and pathname
conventions. For example, in SAS for Windows, the two
LIBNAME statements in the above example would instead
LIBNAME misc 'c:\work'; LIBNAME sasxpt XPORT 'c:\outdata\portable.xpt';
If you have questions about using statistical and mathematical software at Indiana University, email UITS Research Analytics. Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200, and is open for consultation by appointment Monday-Friday 9am-5pm.
This is document aevb in the Knowledge Base.
Last modified on 2015-04-17.
- Fill out this form to submit your issue to the UITS Support Center.
- Please note that you must be affiliated with Indiana University to receive support.
- All fields are required.