Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: transferring data from SPSS to STATA

From   "Kallimanis, Bellinda" <[email protected]>
To   <[email protected]>
Subject   RE: st: transferring data from SPSS to STATA
Date   Wed, 26 Oct 2005 08:36:17 -0400

Have you tried saving the file as a tab delimited (.dat) file and then using -insheet- in Stata? I don't have access to Stat Transfer and this is how I do it. The only problem I encounter is that if a variable has a lot of missing data and is in string format, so as these variables aren't much use to me I remove them and I have no problems and I too work with large datasets with many cases and variables.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Joseph Coveney
Sent: Wednesday, October 26, 2005 2:59 AM
To: Statalist
Subject: Re: st: transferring data from SPSS to STATA

Alonso S´┐Żnchez wrote:

About a year ago someone on the list posted a message regarding problems
transfering an SPSS data file to a Stata file (version 8) using Stata
Transfer. I now have the same problem with several data files, which have
around 1,000 variables (both string and numeric) and over 120,000 cases.
I've looked at the statalist (and my data files) archives, but still can't
find a way around the problem.

The transfer process stops at around the 66,000th case with the message
"Invalid floating point operation." I believe this to be a systematic
problem with one or more of the variables. Has anybody encountered a similar
problem and would know how to find the problem variables?


That's a lot of variables to be sifting through.  How about the following?
Try transferring a single observation.  If that's possible, then you'll have
the list of 1000 variable names in Stata.  You can then have Stata do the
walking through the varlist in a foreach loop that feeds each variable, in
turn, to a Stat/Transfer command processor batch file.  (Don't use operating
system mode, which doesn't allow for selecting variables).  Then run the
batch file and wait until Stat/Transfer balks.  When it does, then you'll
have the first troublesome variable identified.

Joseph Coveney

program define stattransferem
    capture log close
    quietly log using, text
    foreach var of varlist _all {
        display "KEEP `var'"
        display "COPY MySPSSFile.sav MySPSSFile.dta /Y /Q"
    display "Quit"
    quietly log close

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index