How do I use a SAS data file in SPSS?

3 views
Skip to first unread message

gracy layla

unread,
Jan 6, 2018, 12:03:56 AM1/6/18
to SPSS
Using SPSS software:

If you are an SPSS user and you are using SPSS version 14 or later, you can simply open it as a data file, since SPSS supports SAS data files of different formats such as .sas7bdat, .sd7, .sd2, .ssd01 and .xpt. These files can be read directly into SPSS either via using the pull-down menu or via using the syntax.
Using the pull-down menus select File -> Open -> Data… and then for Files of Type select the appropriate sas data file type; then select the file from the list and click Open. That is all to it.
With SPSS syntax we can use the get sas command to read in a SAS data file.
get sas data=’C:datastates.sas7bdat’.
Using SAS software:
Sometimes, there is a need for converting a SAS file to SPSS file outside of SPSS. For example, your colleague is an SPSS user who uses an older version of SPSS and you are a SAS user working with SAS version 9.x.  For your colleague to use the same data in SPSS that you have worked on in SAS, you can simply convert your data in SAS to an SPSS data file for your colleague.
In SAS, we can also save a SAS data file as an SPSS data file using proc export. For example, we have a SAS data set called mydata in the work directory and we can do the following to convert it to SPSS called newdata3.sav. By specifying the file extension as .sav, SAS understands that we want our data file to be converted to SPSS. In the process of conversion, SAS will automatically convert the variable labels and value labels as well.
proc export data=mydata outfile= “C:datanewdata3.sav”;
run;
Stat/Transfer:
There might be situations where neither options above would work. For example, if someone has a SAS data file, works with an older version of SPSS and does not have access to SAS 9.x. Probably the easiest solution in this type of situations is to use Stat/Transfer.

Reply all
Reply to author
Forward
0 new messages