Diff for "FAQ/spsssas" - CBU statistics Wiki
location: Diff for "FAQ/spsssas"
Differences between revisions 2 and 3
Revision 2 as of 2009-04-08 11:20:20
Size: 984
Editor: PeterWatson
Comment:
Revision 3 as of 2013-03-08 10:17:56
Size: 986
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
[:FAQ/saseg1: An example.] [[FAQ/saseg1| An example.]]
Line 29: Line 29:
[:FAQ/saseg2:An example.] [[FAQ/saseg2|An example.]]

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

An example.

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

An example.

None: FAQ/spsssas (last edited 2013-03-08 10:17:56 by localhost)