=========================================================================
Date: Fri, 14 Jul 2006 12:18:54 -0400
Reply-To: Joseph Teitelman temp2 <cmtemp2@pgahq.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Joseph Teitelman temp2 <cmtemp2@pgahq.com>
Subject: For those in need of running SAS using an SPSS file
Content-Type: text/plain; charset=ISO-8859-1
For the past 2 months, I've been forced to learn how to use SPSS, since my employer uses SPSS solely.
For those interested in analyzing data in SAS created as an SPSS *.sav file, the following steps are required.
Note that I discovered this information from the very popular "Little SAS Book."
1) first save your spss file as a portable file * it has the extension por.
2) use the following SAS syntax:
a) LIBNAME myspss SPSS 'c:\Myspsslib\spss.por';
b) to use the print procedure in SAS type
PROC PRINT DATA = myspss._FIRST_;
c) to list the contents of the spss file (the variables and their attributes type:
PROC CONTENTS DATA = myspss._FIRST_;
d) to convert the spss portable file to a SAS data set, type the following:
DATA 'c:\MySASlib\spsspor';
SET myspss._FIRST_;
e) the output will contain a list of observations/ records grouped by each variable in the data set.
The next procedure * Proc contents will produce the variable #, the variable name, the type of variable (num or char, e.g.), Length of each variable, position of each variable, format of each variable. and label for each variable.
Obviously, the information I provided is not intended for those who prefer to use SPSS rather than SAS. It's for those like me, who were forced to learn SPSS for some reason, such as a job, but would like to analyze the data using SAS.
I hope this proves helpful for those of you in the same shoes as myself.
I am not advocating the use of SAS over SPSS; rather I am merely showing that for those who prefer SAS over SPSS, it's easy to read an SPSS file using SAS, after saving the SPSS file as a portable document.