Converting SAS Data Files into Other Formats

This guide picks up where the guides on transferring ICPSR data into SAS leave off. As with the ICPSR-SAS guide, this guide is intended for users who have data in a SAS format but are not familiar with SAS and wish to analyze that data in another stats package. It will show users how to use StatTransfer to convert their SAS files into other formats such as SPSS or Stata. Because of how SAS handles value labels (i.e. it saves them in a separate file called a catalog file), the process here has a few more steps involved than is usually the case when converting files in StatTransfer.

(1). Click on the StatTransfer 7 icon on the desktop or select the program from the Start Menu; StatTransfer's default menu (the "transfer dialog box") will appear. For "Input File Type," select "SAS for Windows/OS2." Under "File Specification," type the file path to your SAS data file or browse using the "Browse" button on the right (in this case, our SAS data file is saved at C:\data\3966).

Next, in the "Output File Type" box, select the file into which you want to convert the SAS data (in this case, we have chosen to transfer the SAS file into SPSS). The "File Specification" box allows users to choose where to save the output file. By default, StatTransfer will (I) assign the name that the SAS file has to the new file but with the proper extension (e.g. *.sav for SPSS, *.dta for Stata) and (II) save it in the same directory as the original SAS file unless you specify otherwise.



Click here for full-size image

(2). Next, select the "Options (1)" tab at the top of the StatTransfer window. In the box labeled "SAS Value Labels", check the first box "Read user formats from a SAS datafile." In the "Filename" box, type the file path to the *_fmts.sas7bdat file you created when you read the raw ICPSR data into SAS, or that should accompany the SAS files. This step is necessary if you wish the value labels that accompany your SAS data file to be transferred over into the SPSS or Stata file you are creating. If there is no *_fmts.sas7bdat file associated with the data file, see the tutorial explaining how to read ICPSR data into SAS before proceeding here. (The other options and settings here can be left as is.)



Click here for full-size image

(3). Finally, click on the "Transfer" tab to return to the transfer dialog box. Then click the "Transfer" button in the lower left. The data set should appear in the directory specified in the "File Specification" box for the output file.



Click here for full-size image


When opening up your new data file, you may notice that the variable labels did not carry over. If this happens, you need to run the transfer in StatTransfer again exactly as show above. Check the file size of your data file before and after you run the transfer a second time. It should be larger the second time around.




Data Analysis

Page adapted from Electronic Data Center, Emory University Libraries
Original text by Amy Yuen