Creation date: 05/12/98
Authored by: Karl Ho
Question:
How to convert a SAS data set into SPSS?
Answer:
SPSS can read in SAS data set in transport file format using the following statement:
GET SAS DATA='filename'.
Before that, one needs to convert the SAS dataset into a transport file using the following SAS program:
/* Defining in and out libraries, where inlib is where the SAS */
/* data set resides and outlib is the transport file's directory. */
/* In this case, both are in the same c:\temp directory */
libname outlib xport 'c:\temp\test.trn';
libname inlib 'c:\temp';
/* Data step that convert the file "test" (test.sd2) into SAS */
/* transport file test.trn*/
data;
set inlib.test;
proc copy in=inlib out=outlib;
select test;
run;
The resulting SAS file in transport file format, test.trn, will be located in the c:\temp directory.
Last updated: 01/18/06 by Karl Ho