Announcement

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

  • .dta not Stata format r(610); - the same version Stata

    Hello everyone,

    I need an urgent help from you guys. Currently, I'm using Stata 12 in Windows. I edited my dta file and saved it but I didn't close the Stata program. All of sudden, my computer restarted so I tried to open the dta file again but couldn't open it.

    file A.dta not Stata format
    r(610);

    Stata shows the error message like the above. I googled it but most of the suggestions were about different versions of Stata, i.e. trying to open Stata 13 dta file using Stata 12. But, in my case, I edited my stata dta file using Stata 12 and I can't open it now...... I spent more than 20 hours on editing the dataset and I see the data size of dta file is about the same before I started editing so I believe the information is still there. It's just that I can't open the file. Please help! Thank you in advance!

    Yeon Joon


  • #2
    Yeon Joon,

    That error message can be misleading, because that error message can also be shown when the file does not exist in the specified location.

    I have gotten that message when I have mistyped the filepath to the file in loading a data set. In that case Stata could not find the data file, but it reported the same error message you received implying that it found the data file but that it was in the wrong Stata format.

    I suggest you check the file path you are using in command line loading the data set. If the file path contains spaces, be sure to surround it with double quotes.

    Good luck.

    Red Owl

    Comment


    • #3
      Thank you for your suggestion, Red Owl. However, I double-checked and the filepath is correct. For example, I was able to open other dta files in the same filepath but not this dta file. Can anyone else help on this? Thanks!

      Comment


      • #4
        You've tried opening it interactively? That way you know the file path is right.

        I assume you've lost the ability to put your previous commands into a do file? (Stata has some ability to copy the commands you've entered interactively into a do file. I've never used it so I don't know the details.)

        It could be that the file is corrupted.

        As a point of style, many of us never manually edit data files. Most of us create programs that do the editing. Then we (i) have a clear documentation of the way our data set was created, and (ii) can go back and start over easily. If you must edit directly, save the file under slightly different names over time so you can't lose everything.

        Comment


        • #5
          Yeon, type hexdump filename.dta and make the result available for examination. Best, Sergiy

          Comment


          • #6
            I have a similar problem. After typing hexdump filename.dta, this is my result below. How may you help me, please?
            Click image for larger version

Name:	Picture1.png
Views:	1
Size:	3.8 KB
ID:	1684349



            .

            Comment


            • #7
              From the hexdump screenshot(?) in #6, we can tell that this is not a file saved in Stata's format. The file appears to be empty.

              Comment


              • #8
                I remember saving it before closing the file. What could lead to this? However, I made a duplicate a few days ago. Just that the data was edited before I lost the edited it, and if I'm to use the duplicate, it means I have to start editing all over again.
                Last edited by Paulina Brago; 04 Oct 2022, 23:45.

                Comment


                • #9
                  That sounds terrible.

                  But also a reminder that one should almost never be editing the Stata data file directly. Make edits using code, so they're replicable --- and recoverable!

                  Comment

                  Working...
                  X