SPSS Statistics

 View Only
  • 1.  Importing data from Stata to SPSS

    Posted Thu August 04, 2022 09:45 AM
    I have around 20 datasets in Stata that I am trying to import into SPSS. For around eight of those datasets, trying to import them into SPSS always displays the following message: 

    >error # 7223 command name: Get Stata
    >data read error
    >execution of this command stops

    Can anyone tell me why this is happening, and how I might be able to fix the issue?

    I am using SPSS version 21 and all the Stata files are stored as Stata version 13. I do not understand why the error only occurs for some of the datasets while there are no problems with the others.

    Would be grateful for any advice or assistance here. Thank you.



    ------------------------------
    Dipanwita Ghatak
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Importing data from Stata to SPSS

    IBM Champion
    Posted Thu August 04, 2022 09:48 AM
    A data read error suggests that these files are corrupted.  Can you actually still read them in Stata?

    If you can, maybe exporting as csv files from Stata would work.

    --





  • 3.  RE: Importing data from Stata to SPSS

    Posted Wed December 20, 2023 10:05 AM

    I've got similar error message, I was curious maybe the .dta files came from STATA newer .dta format.

    I already try open the .dta files using Haven (R packages) and the data was fine.

    I've also open it in STATA 17, and the .dta file open correctly.

    From STATA, I've convert it to STATA 12/13 .dta format and then I try to open it in IBM SPSS 22 and give these error message:
    >Error # 7202.  Command name: GET STATA 
    >Input dictionary read error. 
    >Execution of this command stops. 



    ------------------------------
    Andrei Ramani
    ------------------------------



  • 4.  RE: Importing data from Stata to SPSS

    Posted Wed December 20, 2023 10:11 AM

    Hi @Dipanwita Ghatak and @Andrei Ramani,

    First, I'd agree with @Jon Peck, and make sure these files are themselves not corrupted in some way.

    Next, the GET STATA command has an /ENCODING subcommand.  Is it possible that your current SPSS Statistics unicode settings and locale settings do not match the encoding of your STATA file?



    ------------------------------
    David Dwyer
    SPSS Technical Support
    IBM Software
    ------------------------------



  • 5.  RE: Importing data from Stata to SPSS

    IBM Champion
    Posted Wed December 20, 2023 11:44 AM
    Adding to Dave's comments, when you tried to open the file after converting it in Stata and got the read error, might the file still have been open in Stata?  That would probably prevent Statistics from being able to access it since it would have been in write mode in Stata.  Even if the file writing had finished, it might not have been closed.

    --





  • 6.  RE: Importing data from Stata to SPSS

    Posted Tue December 26, 2023 07:23 AM

    Certainly, I've already make sure the .dta not currently access by any other apps.



    ------------------------------
    Andrei Ramani
    ------------------------------



  • 7.  RE: Importing data from Stata to SPSS

    Posted Tue December 26, 2023 07:21 AM

    Already check the encoding ..... the .dta files and IBM SPSS use the same en_US encoding.



    ------------------------------
    Andrei Ramani
    ------------------------------



  • 8.  RE: Importing data from Stata to SPSS

    Posted Tue December 26, 2023 07:28 AM

    Currently, I've use (temporary) solution:

    • Using STATA 17, save as the .dta files to old .dta (STATA 13 version)
    • then the .dta transfer to .sav format using STAT/Transfer

    I hope the IBM SPSS dev can make sure the compatibility with current format STATA version



    ------------------------------
    Andrei Ramani
    ------------------------------