Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

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:

LIBNAME misc '~/work'; LIBNAME sasxpt XPORT '~/outdata/portable.xpt'; PROC COPY IN=misc OUT=sasxpt; SELECT job1; RUN;

In the example above:

  • The first LIBNAME statement aliases the library reference (libref) misc to the work directory.

  • The second LIBNAME statement aliases the libref sasxpt with the physical name of a SAS transport format file (in this case, portable.xpt in the outdata directory).

  • The COPY procedure copies one or more SAS data sets in the IN= libref (in this case, misc) to the OUT= libref (in this case, sasxpt).

  • The SELECT statement specifies that only the file job1.sas7bdat should be included in the transport file portable.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:

LIBNAME misc 'c:\work'; LIBNAME sasxpt XPORT 'c:\outdata\portable.xpt';

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.

This is document aevb in domain all.
Last modified on January 24, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.