Announcement

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

  • "not STATA format" when trying to load .dta files from later STATA version

    STATA 12.1

    I get an error trying to use .dta files from a future version of STATA.
    I tried to use R to convert them to .csv files to then convert them back to dta files in STATA, but then I get tonnes of issues with variables changing types. I have too many files for that to be a manageable thing to solve.

    Are there no tools for STATA that can help me with using future versions of dta files?

  • #2
    What is the version of the "future version" of Stata? Can you not ask the source who provided you the datasets to save them in old format? Stata has a -saveold- option to make data compatible for older version

    Code:
    saveold filename, version(12)
    Last edited by Roman Mostazir; 09 Feb 2022, 09:26.
    Roman

    Comment


    • #3
      Based on my read of -help dtaversion-, if your dataset has less than 32,768 variables, then any saved dta file from version 14 onwards should also be able to be opened by version 14 or later. So please tell us which version of Stata you are using, and what version are the datasets made from (you can use -dtaversion filename.dta- to find this out).

      Comment


      • #4
        Originally posted by Leonardo Guizzetti View Post
        [...] So please tell us which version of Stata you are using, and what version are the datasets made from (you can use -dtaversion filename.dta- to find this out).

        Victor Nielsen is using Stata 12.1, as I understand. dtaversion was introduced in Stata 13. Victor's best chance is to follow the suggestion in #2. Perhaps use13 (also available from SSC) can help, too.

        Note that the details of data file format are documented in [P]File formats .dta. You could get the version from the file (e.g. with hexdump) or, with much more (most likely too much) effort, read the complete dta-file.

        Comment


        • #5
          Thanks, Daniel, I missed that he stated his version number. There is also -use13save12- which may be useful that I think builds on -use13- (both available from the SSC).

          Comment

          Working...
          X