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   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: transferring data from SPSS to STATA
Date   Wed, 26 Oct 2005 15:59:23 +0900

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 stattransferem.stc, text
    foreach var of varlist _all {
        display "KEEP `var'"
        display "COPY MySPSSFile.sav MySPSSFile.dta /Y /Q"
    }
    display "Quit"
    quietly log close
end
stattransferem
stcmd stattransferem.stc
exit

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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