Statalist


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

Re: st: Importing data with infile: Identifying records with problems


From   Sergiy Radyakin <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Importing data with infile: Identifying records with problems
Date   Wed, 2 Sep 2009 17:10:36 -0400

On Wed, Sep 2, 2009 at 4:57 PM, John LeBlanc<leblancj@dal.ca> wrote:
> Hi,
>
> Is there any way that Infile can report a specific part of a record when
> there is an error as opposed to a record number? I am importing dozens of
> scanned files and getting hundreds of lines like the following:
>
> '*' cannot be read as a number for tfake[153]
> '*' cannot be read as a number for corl[157]
>
> It would be much easier for me to deal with these if instead of the record
> number, e.g., 153, I could somehow instruct stata to report the first six
> characters of the record with the problem since those characters represent
> the research participant's serial number. Also, the record numbers start at


I am afraid it is not possible. And we are quite lucky that in this case Stata
reports in which record there was a problem. When it comes to errors in .ado
programs, it only tells you the error code, but not the line number.

At least basic error reporting in relation to the source code is
highly desirable
and would make debugging .ado files a much more pleasant task, ultimately
improving the quality of the code. See, how it was done in TurboPascal in the
1980s:
http://ugweb.cs.ualberta.ca/~roman/tutorials/History/F2000WinNT4/Pascal/editing.html

Best, Sergiy Radyakin



> one for every text file that is imported and it therefore becomes quite a
> headache to manage both a relative record number and file identifier.
>
> Thanks for any advice.
>
> --
>
> Regards, John LeBlanc
>
> _________________________________________________________
>
>
>
> John C. LeBlanc, MD, MSc, FRCPC
> Associate Professor
>
> Pediatrics, Psychiatry, Community Health and Epidemiology
>
> Dalhousie University
>
>
>
> IWK Health Centre              Work phone: (902) 470-8930
>
> 5850 University Avenue         Work fax:   (902) 470-6913
>
> Halifax, Nova Scotia           Email: John.LeBlanc@Dal.Ca
>
> B3K 6R8 CANADA                 Pager: (902) 470-8888
>
> ________________________________________________________________
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index