Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SPSS-file won't open

    Dear all,

    I am trying to open an SPSS-file with Stata, but it seems that the file is too large. My SPSS-file is about 540 MB and when I save it as a Stata-file, it is about 3.5 GB. I tried to open the file with the command "set memory" (but "1000m" doesn't seem enough) and with useSPSS (doesn't seem to work either). Can anyone give me some tips?

    Many thanks in advance,

    Rozemarijn

  • #2
    To quote from the "old" FAQs (http://www.stata.com/support/faqs/re...ist-faq/#stata)

    Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly!


    As you mention set mem you are obviously using a Stata version 11 or earlier, since Stata 12 introduced automatic memory settings. You are asked to state which version you are using, otherwise we assume it is Stata 13.1.

    You are also asked to explain wehere user-written commands you refer to come from. In your case usespss is fom the SSC (http://ideas.repec.org/c/boc/bocode/s456957.html).

    Best
    Daniel

    Comment


    • #3
      SPSS has no clue about data formats that Stata supports, and writes -byte- variables as -double-, and all string variables as -str240-. Your file will shrink down eventually after you -compress- it. As Daniel pointed out, "does not work" does not work on statalist, and you need to explain what you've done and what you've obtained. A solution I can offer is to break your SPSS file into chunks of say 1000 observations, save them separately, -compress- each of them and then -append- them back together in Stata.
      -- Stas Kolenikov || http://stas.kolenikov.name
      -- Principal Survey Scientist, Abt SRBI
      -- Opinions stated in this post are mine only

      Comment


      • #4
        Rosemarijn,

        I am the author of the usespss command. You don't write, which version you use so I assume it's the SSC version. Hence you must be using a 32-bit version of Stata.
        It should be able to convert the file to Stata format, but perhaps the result is larger than can be opened in Stata 32-bit.
        So what can you do?
        1. you can employ the option saving of the usespss command. That should create the file on disk completely irrespectively of whether Stata can open it or not. You can later load data from it partially e.g. by 1000 of observations at a time; or you can open it later in a 64-bit Stata session. Note that working with large files requires some attention to memory. Make sure you understand the memory use diagram from my presentation at the Chicago Stata user group meeting and you use the options memory and lowmemory accordingly.
        2. you can employ the new version of usespss from a 64-bit version of Stata. Treat this version as beta. This version does not require you to set the memory options.
        Code:
        usespss "c:\data\mydata.sav", saving("c:\data\mydata.dta") memory(800) lowmemory(10)
        or
        Code:
        spss convert, from("c:\data\mydata.sav") to("c:\data\mydata.dta")
        Both old and new versions do on-the-fly types optimization.

        Also note the comment from Stas regarding "does not work". If you feel there is a bug in the usespss command, kindly let me know. There were a number of them fixed in recent years.

        Hope this helps, Sergiy Radyakin

        Comment


        • #5
          Dear all,

          Many thanks for your advise! I want to apologize for not mentioning some important details in my question, I'm new to the forum and should have read the FAQs better. By breaking my SPSS file into chunks of about 1000 observations, I managed to solve the problem.

          Comment

          Working...
          X