- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-13-2010 05:44 PM
(1629 views)
Hi,
I need to convert sas file to SPSS file. Could you please show me the syntax for this purpose? It would be more helpful if label in sas data can be converted as well.
Thanks.
YD
I need to convert sas file to SPSS file. Could you please show me the syntax for this purpose? It would be more helpful if label in sas data can be converted as well.
Thanks.
YD
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Check out PROC EXPORT
PROC EXPORT DATA= filename
OUTFILE= "C:\mydr\newfile.sav"
DBMS=SPSS REPLACE;
Writes out a file named filename to the mydir folder on my c: drive and saves it as an SPSS file named newfile.sav
You really don't need to do this, though, if you want to open a SAS dataset in SPSS. Just go to SPSS and from the FILE menu select OPEN. For type, scroll down to where it says SAS. This will import your SAS dataset into SPSS, including the labels. The SPSS syntax is
GET
SAS DATA='C:\mydir\filename.sas7bdat'.
AnnMaria
PROC EXPORT DATA= filename
OUTFILE= "C:\mydr\newfile.sav"
DBMS=SPSS REPLACE;
Writes out a file named filename to the mydir folder on my c: drive and saves it as an SPSS file named newfile.sav
You really don't need to do this, though, if you want to open a SAS dataset in SPSS. Just go to SPSS and from the FILE menu select OPEN. For type, scroll down to where it says SAS. This will import your SAS dataset into SPSS, including the labels. The SPSS syntax is
GET
SAS DATA='C:\mydir\filename.sas7bdat'.
AnnMaria
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I usually rely on Stat/Transfer.
Once you convert your SAS data to a SPSS system file, try converting back to SAS data set (with a different name). And then run PROC COMPARE to see what you have preserved and what you have lost.
SPSS has a single system missing value, but each variable can have multiple user-defined missing values. SAS has 28 different missing values for numeric variables and has no equivalents to SPSS's user-defined missing values.
Once you convert your SAS data to a SPSS system file, try converting back to SAS data set (with a different name). And then run PROC COMPARE to see what you have preserved and what you have lost.
SPSS has a single system missing value, but each variable can have multiple user-defined missing values. SAS has 28 different missing values for numeric variables and has no equivalents to SPSS's user-defined missing values.