Psyc 7291: Multivariate Stats (Carey, 01-15-03)
STEP 1: Start up SPSS and convert the SPSS data to a "portable" data set (i.e., a .por data set). To do this, simply open the data set, click on the File menu and select Save As. A window will appear. In the File Format section, click on "SPSS Portable." When you name the file make certain to add the .por extension; SPSS does not do this automatically. See the special note at the end if you are transferring the SPSS data set from one computer to another. For this example, let's assume that we have saved the SPSS data set wolfdata.sav in portable file format as "wolfdata.por" in directory ~myname/myspssstuff.
STEP 2: Start up SAS. In the program window, give a LIBNAME
statement to the SPSS portable data set. this LIBNAME statement must
contain the qualifier SPSS after the nickname. For example,
LIBNAME convert SPSS '~myname/myspssstuff/wolfdata.por';
STEP 3: Give a second LIBNAME statement for the directory
where you want to save the converted SPSS data. For example, suppose
that you want to save the data in directory
~myname/whydidievertakethiscourse. The appropriate LIBNAME statement
could be
LIBNAME why '~myname/whydidievertakethiscourse';
STEP 4: Use PROC COPY to convert the data set. For this
example,
PROC COPY IN=convert OUT=why;
RUN:
STEP 5: Rename the SAS data set. SAS does not retain the
SPSS data set name and instead will call it _FIRST_. The following
SAS statements will rename the data set back to wolfdata.
PROC DATASETS LIBRARY=why;
CHANGE _FIRST_ = wolfdata;
RUN;
QUIT;
NOTE WELL: SPSS portable data sets are not quite as portable as it seems. If you are transferring a .por data set from one computer to another, then you may have to call up SPSS on the second computer and resave the .por file. For example, if you create a .por data set on a PC and then ftp it to samiam, then you must start SPSS on samiam, open the .por file (use the File menu and select Open) and then resave it by clicking on the File menu and selecting Save As. Any name will due, but make certain that it is save as an SPSS portable file with a .por extension.