How do I read a SPSS data file into SAS?
There are two ways to read SPSS data files into SAS. One creates a SAS readable file inside SPSS whilst the other prepares a text file for reading into SAS for use with the INFILE command.
To creating a SAS data file called work.sas directly from SPSS for use in SAS:
1. SAVE SPSS FILE AS SAS TRANSPORT *.XPT
2. EXIT SPSS FILE
3. CLICK ON .XPT FILE (THIS DATA FILE IS CALLED WORK.SAS)
4. CLICK ON the command file of form *.SAS
Alternatively to import from SPSS into a text file readable in SAS using the infile command as follows:
1. SAVE THE SPSS FILE AS AN EXCEL 97 OR LATER FILE
2. OPEN IN EXCEL AND SAVE AS A TAB DELIMITED *.TXT FILE
3. OPEN THE *.TXT FILE AND REPLACE THE TAB WITH A SPACE AND THE #NULL WITH A FULL STOP (FOR MISSING VALUES IN SAS)
4. SAVE THE FILE
5. THIS FILE IS NOW READY TO BE READ INTO SAS WITH THE INFILE COMMAND