| Date: | Tue, 3 Feb 2004 16:34:05 -0600 |
| Reply-To: | Toby Dunn <tdunn@OAKHILLTECH.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Toby Dunn <tdunn@OAKHILLTECH.COM> |
| Subject: | Re: SAS file to SPSS file |
| In-Reply-To: | <12F2E18D680DD311B03D0000F8059A150502533F@VHAANNEXC1> |
| Content-Type: | text/plain; charset="us-ascii" |
Well, thank you all for most generous advice. Some days I wish I wasn't so
new to SAS or programming for that matter.
Thanks,
Toby Dunn
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Laurel
Copeland
Sent: Tuesday, February 03, 2004 4:20 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: SAS file to SPSS file
FWIW, below are the contents of my crib file for going between SPSS and SAS.
This used to work. I haven't had access to SPSS in a few years. HTH, Laurel
********************************************
*SAS2SPSS*;
*SAS
* Your SAS data set is in the library SASDATA;
* the data set is called SASDATA.OWEN ;
libname SASDATA 'c:\sas\mydata\';
libname SAS2SPSS xport 'c:\sas\owen.xpt';
proc copy in=SASDATA out=SAS2SPSS;
select OWEN;
run;
* If you are exporting a temp file, substitute 'in=WORK'
* and omit the first libname statement *;
SPSS
COMM Example: No formatted variables .
get sas data='c:\sas\owen.xpt' .
execute .
* Formatted variables example
* In addition to the data step above, you must take
* care of your formats as follows
* Your formats catalog is in the library LIBRARY *;
libname library 'c:\sas\catalogs\';
proc format library=library cntlout=fmts;
run;
libname fmt2spss xport 'c:\sas\FMTS.xpt';
proc copy in=work out=fmt2spss;
select FMTS;
run;
/* SPSS */
/* If you are converting a SAS formats catalog as well as a SAS data
/* set then you should use these commands */
get sas data='c:\sas\owen.xpt' /formats='c:\sas\fmts.xpt'.
execute .
***FROM SPSS TO SAS**** .
/* In SPSS */
COMM Watch dates during this process .
print format date DOB (Adate10) .
exec .
EXPORT OUTFILE='C:\safe\stuff.por'.
/* In SAS */
libname somethin SPSS 'c:\safe\stuff.por';
data stuff; set somethin.stuff; run;
********************************************
-----Original Message-----
From: edwardsm@UOGUELPH.CA [mailto:edwardsm@UOGUELPH.CA]
Sent: Tuesday, February 03, 2004 12:44 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: SAS file to SPSS file
Good day all!
I'd just like to add a little note to the transition from SAS to SPSS
datafiles. We use DBMSengines here on Campus to move from SAS to SPSS...
HOWEVER..... I have not found a way to maintain the library formats in SAS
when moving to SPSS. I can select SPSS sav files or SPSS por files -
either
way it does not maintain the variable value labels.
Has anyone else encountered this and maybe found a way around it? SAS
suggested I tried DBMS Copy on my SUN system to accomplish this...
Thanks,
Michelle
___________________________________
A. Michelle Edwards, Ph.D.
Academic Services, CCS
Vehicle Services Bldg, University of Guelph
Guelph, Ontario
N1G 2W1
PH: (519) 824-4120 Ext. 54539
FAX: (519) 767-1620
Email: edwardsm@uoguelph.ca
___________________________________
|