One of the most common importation question asked is how to import SPSS files into SAS. My longterm plan is to provide a quick guide on how to import every file format into SAS. However, SPSS is by far the most frequently asked format, so it will be explained first.
Two excellent options exist:
1.) Through a program, like Stat-transfer
2.) Via an SPSS portable file straight into SAS.
*********************************************
Option 1, Stat-transfer is an excellent program for a simple conversion from an SPSS file into a SAS file. It can be used for either an SPSS portable file (.por) or a normal SPSS data file (.sav). This program does cost money, so it isn't a preferred option, unless you need to transfer a variety of file formats into SAS files (i.e. Access, ascii, excel, matlab, minitab, s-plus, STATA, ect.). Stat-transfer is the only transfer program I have used. It has always worked great, so I would recommend this program if you frequently need to import files into SAS from a variety of data formats.
Option 2, Import a portable SPSS file directly into SAS.
The first step is save the SPSS data file as a portable file (.por).
1.) Open the file in SPSS.
2.) Go to File -> Save As...
A new window will open, you will type in the new file name and in the "Save as type" drop down menu, choose "Portable (*.por)". This will save the file into the same folder as the original
SPSS file unless otherwise stated.
***Note: You will see the option of saving the file as "SAS v7+ Windows long extention (*.sas7bdat). This is the normal SAS file extension, but this will often not import into SAS properly.
Now your file is saved as a portable SPSS file, lets get it into SAS.
*****************************************************************************
libname a spss 'd:\SAS Folder\spssfile.por';
Related Articles
This post first appeared on SAS Beginner's Guide-Tips, Help And Statistics, please read the originial post: here