Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Error 612 on .dta in Stata 13.1


From   James Fiedler <jrfiedler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Error 612 on .dta in Stata 13.1
Date   Mon, 9 Dec 2013 13:01:19 -0600

Since the number of observations is contained in the .dta header, I
would assume that if the datasets were incomplete, both Stata11 and
Stata12 would complain. (But of course that's just guessing.)

If you use Python, you could try using my stata_dta module:
https://github.com/jrfiedler/stata-dta-in-python

I recommend it for a couple reasons:
1. It should (hopefully) open any correctly specified format 114 file
(and if it doesn't I'll try my best to fix it).
2. If there is an error, you should get an error message with a line
number, and inspecting the code around that line might be informative.
3. If you know Python, it should be fairly easy to add output in the
function _file_to_Dta115() (which opens formats 114 and 115) to give
you updates on what part of the file it's processing, so it's easier
to tell when it stops working, if it stops working.
4. You can convert a format 114 dataset to format 117 if desired, then
try opening that in Stata13. See "Opening a .dta file" in
https://github.com/jrfiedler/stata-dta-in-python/blob/master/EXAMPLES.rst


James

On Mon, Dec 9, 2013 at 11:45 AM, Sergiy Radyakin <serjradyakin@gmail.com> wrote:
> I have two Stata datasets sent by a user via email. Each file starts
> with "r" and as such is based on specification-114. Stata 11 and 12
> (Windows) can open the file without any problem. StataMP 13.1 for
> Windows refuses to do so with an error code 612 and error message:
>
> . use "datafile.dta", clear
> .dta file corrupt
>     The file unexpectedly ended before it should have.
> r(612);
>
> without loading the data. Since I do not know the 'true' content of
> the file, I don't know whether the data that is opened in Stata 12 is
> a:
> -- partial dataset? (only surviving observations shown, fewer than declared)
> -- complete dataset? (all observations surviving, Stata 13 gives a false alarm)
> -- or corrupt dataset? (all observations, but some data is incorrect)
>
> Furthermore, if I use my saveto9.exe on this dataset it creates a file
> that Stata 9 can also open without any error message. This tells me
> that the header is likely to be valid and intact.
>
> Both files provoke identical problem, and surprisingly they have
> identical size (around 4MB), but expectedly different content. The
> identical  size might be a coincidence or evidence of trimming,
> intentional or accidental.
>
> I need to know if this is a false alarm and the file is actually in
> order, or Stata 13.1 is indeed detecting some inconsistencies that
> Stata 12 didn't watch for?
>
> I wonder if anyone has had an experience like that and whether there
> is a known incompatibility or a problem with any other software
> creating .dta files (e.g. SPSS, R, etc). The reason I suspect other
> software is that there is no visible timestamp that Stata usually
> saves into the file. In Stata 12 I see:
>  c(filedate) = ""
> Afaik the date in file was optional. Has anything changed in Stata 13?
>
> The help for error 612 does not give any info in the .dta-context, and
> a somewhat more precise error message would be helpful (e.g. "only 40
> out of 74 observations read successfully", or "value labels not
> found", etc).
>
> Thank you, Sergiy Radyakin
>
> PS: no, I can't share the data files; and yes, I am already following
> up with the user on the history of the file, so far nothing to add.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index