Diff for "FAQ/spsssas" - CBU statistics Wiki
location: Diff for "FAQ/spsssas"
Differences between revisions 1 and 2
Revision 1 as of 2009-04-08 11:14:05
Size: 984
Editor: PeterWatson
Comment:
Revision 2 as of 2009-04-08 11:20:20
Size: 984
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
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

[:FAQ/saseg1: 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

[:FAQ/saseg2:An example.]

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