How do I use a SPSS data file in SAS
1. Using SAS software
SAS 9.x supports SPSS data files (*.sav). The following example shows how to use SAS proc import to read in a SPSS data file called hsb2.sav. It is advisable to check the log file and use proc contents to ensure the data have been read correctly. Notice that SAS recognizes the file type to be imported by file extension.
proc import datafile = "c:\datahsb2.sav" out= work.hsb2; run; proc contents data=hsb2; run;
2. Using SPSS software
SPSS supports SAS data files and can easily save an SPSS file as a SAS file through the point and click interface or syntax. Using the pull-down menus select File then Save As… and then for Save as type select an appropriate SAS format, e.g., select SAS v7+ Windows Long File Extension (*.sas7bdat) for Windows. Type the file name and click Save to save the SAS file. To use SPSS syntax, use the save translate command as shown below.
save translate outfile='C:\datahsb2.sas7bdat'.Data written to C:\datahsb2.sas7bdat. 11 variables and 200 cases written. [output omitted for space]
Note that SPSS is also compatible with the following SAS extensions: (*.sd2), (*.sd7), (*.xpt) and (*.ssd01).
Stat/Transfer can be used to convert SPSS data files into SAS data files, and doing this conversion is easy and straightforward.