Announcement

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

  • .dta file corrupt error r(612)

    Good morning,

    I just tried to open a dataset I built and I have been using since yesterday and today I got this message

    Code:
    .dta file corrupt
     The file does not record <varnames> where expected.  Either the file was written incorrectly in the first
        place or the file has become corrupted.
    r(612);
    I Googled around and I found past discussion about similar poblem but I did not find any solution to this specific problem. Do you have any idea?

    Thanks

  • #2


    You wish to take a look at dtaverify, here.
    Best regards,

    Marcos

    Comment


    • #3
      I tried to use it but it does not even find the dataset. I correctly specified the path and the name but it says it cannot find the dataset.

      Comment


      • #4
        Originally posted by Alessandro Sovera View Post
        I tried to use it but it does not even find the dataset. I correctly specified the path and the name but it says it cannot find the dataset.
        Show the exact command that you have typed and the exact output that you are getting. It is impossible to give any further advice given the information you provide.

        Best
        Daniel

        Comment


        • #5
          Code:
          dtaverify "...\FULL DATASET.dta"
            (file "...\FULL DATASET.dta" is .dta-format 118 from a Stata
             after Stata 14)
          cannot verify .dta format-118 files
              dtaverify does not have a verifier for format-118 files.  Format 117 is the current data format for Stata
              14.  Format 118 must have come afterwards.  To read this file, you must update or upgrade your copy of
              Stata.
          This is the ultimate result I got. It actually recognizes the file as a dataset but it is unable to verify it.

          Comment


          • #6
            So here's one thought. If this file is in a location where it might be used by somebody else, perhaps somebody running a more recent version of Stata than you are, has used the file and then -save-d it again. That could result in the file being saved in a format that is not readable by your older version of Stata. In particular, the message you are getting from Stata says that the file is in .dta-format 118, which is the latest format StataCorp has released. This format is readable by version 15. I'm not sure about version 14. It is certainly not readable by version 13.

            The solution would be to find whoever saved it from version 15, ask that person to re-open it, and then use -saveold- to save it in a format readable by your version of Stata. (-saveold- can go back as far as version 11.) It probably would also make sense to do this using a new filename so that the problem won't happen again.

            Comment


            • #7
              This text may explain the difference: https://www.loc.gov/preservation/dig...dd000471.shtml
              Best regards,

              Marcos

              Comment


              • #8
                Thanks to both of you!

                Comment


                • #9
                  Clyde Schechter
                  I am facing the same issue " dataset corrupted
                  However, I have run the command above
                  and I got the following message
                  HTML Code:
                    dtaverify "E:\Risk Management\new dataset\RMC_paper_without_Banks.dta"
                    (file "E:\Risk Management\new dataset\RMC_paper_without_Banks.dta" is .dta-format 118 from Stata 14 or
                     15)
                  
                   1. reading and verifying header
                      release is 118
                      byteorder LSF
                      K (# of vars) is 446
                      N (# of obs) is 68,785               
                      label length 0 ||
                      date length 17 | 1 Jan 2018 06:31|
                  
                   2. reading and verifying map
                      map[ 1] =                    0
                      map[ 2] =                  158
                      map[ 3] =                    0
                      map[ 4] =                    0
                      map[ 5] =                    0
                      map[ 6] =                    0
                      map[ 7] =                    0
                      map[ 8] =                    0
                      map[ 9] =                    0
                      map[10] =                    0
                      map[11] =                    0
                      map[12] =                    0
                      map[13] =                    0
                      map[14] =                    0
                      verifying map
                      1 2 3SERIOUS ERROR: |<stata_dta><head| found where |<variable_types>| expected
                   4SERIOUS ERROR: |<stata_dta| found where |<varnames>| expected
                   5SERIOUS ERROR: |<stata_dta| found where |<sortlist>| expected
                   6SERIOUS ERROR: |<stata_dt| found where |<formats>| expected
                   7SERIOUS ERROR: |<stata_dta><header>| found where |<value_label_names>| expected
                   8SERIOUS ERROR: |<stata_dta><heade| found where |<variable_labels>| expected
                   9SERIOUS ERROR: |<stata_dta><heade| found where |<characteristics>| expected
                   10SERIOUS ERROR: |<stata| found where |<data>| expected
                   11SERIOUS ERROR: |<stata_| found where |<strls>| expected
                   12SERIOUS ERROR: |<stata_dta><he| found where |<value_labels>| expected
                   13SERIOUS ERROR: |<stata_dta><| found where |</stata_dta>| expected
                   14SERIOUS ERROR: map[1] invalid
                  
                  
                   3. reading and verifying vartypes
                  
                   4. reading and verifying varnames
                      verifying varnames unique
                  
                   5. reading and verifying sort order
                      verifying contents
                  
                   6. reading and verifying display formats
                      verifying formats
                      verifying formats correspond to variable type
                  
                   7. reading and verifying value-label assignment
                      verifying value-label construction
                      verifying value label and corresponding variable types
                  
                   8. reading and verifying variable-label assignment
                      verifying variable labels construction
                  
                   9. reading and verifying characteristics
                      (37 characteristics in file)
                      verifying construction
                      verifying characteristics unique
                  
                  10. reading and verifying data
                      (dtaverify_118 cannot verify that values are correct)
                      verifying construction
                      (0 strL variables)
                  SERIOUS ERROR: unexpected end of file
                      Stopping; this error prevents continuing to check for other errors.  Serious errors detected
                  r(459);
                  Could please check and tell me what should I do?

                  Comment


                  • #10
                    The data file seems to be seriously corrupted. I don't know of anything that you could do to repair it. I think you have to re-create the file. If you have a backup copy of the file that worked previously, use that. If not, you may have to re-generated it by running whatever code originally created it.

                    Comment


                    • #11
                      Originally posted by Clyde Schechter View Post
                      The data file seems to be seriously corrupted. I don't know of anything that you could do to repair it. I think you have to re-create the file. If you have a backup copy of the file that worked previously, use that. If not, you may have to re-generated it by running whatever code originally created it.
                      Thank you for replying
                      I just wanted to be clear about a stentence you wrote "you may have to re-generated it by running whatever code originally created it" Do you mean there are codes to recreate the file or I have to recreate it as I did at the first place ?

                      Comment


                      • #12
                        I mean you have to recreate it as you did in the first place if you do not have a backup copy.

                        Comment


                        • #13
                          By the way, before you re-create the file, if this file was stored on a drive on your own computer, you should run whatever disk diagnostic tests your operating system offers you. If there is a problem with that drive, you want to fix that before you commit any more of your data to it. If the file was stored on a remote server, you should notify your system administrator that you encountered this problem, so he or she can check the drive.

                          Comment


                          • #14
                            Originally posted by Clyde Schechter View Post
                            By the way, before you re-create the file, if this file was stored on a drive on your own computer, you should run whatever disk diagnostic tests your operating system offers you. If there is a problem with that drive, you want to fix that before you commit any more of your data to it. If the file was stored on a remote server, you should notify your system administrator that you encountered this problem, so he or she can check the drive.
                            Thank you very much

                            It actually was stored before on D driver of my laptop
                            but I do not how to run disk diagnostic tests your operating system.
                            Kindly do you mean a recovery software to recover deleted files or something esle through STATA?

                            Thanks a lot for responding

                            Comment


                            • #15
                              Every modern operating system has some built in software that checks the hard drive for problems. How you access and run that software is going to depend on the specifics of your operating system and computer, so I can't give you directions. It's nothing related to Stata: I'm talking about a utility program that inspects the hard drive for problems and, where possible, fixes them.

                              Comment

                              Working...
                              X