Statalist


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

Re: st: current do file if error message


From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: current do file if error message
Date   Wed, 30 Sep 2009 14:34:00 -0400

No, Stata does not report the file and line number where the error has occured.
There are different ways to get around this by injecting
comments/display statements throughout the code. None satisfies me so
far.
Also, consider changing your project. Stata is not very capable of
managing a project of 100 files (in the Microsoft Visual Studio
sense).
Perhaps this could be reduced to 2 files, where one master file calls
a another file with some parameters?

Best regards, Sergiy Radyakin

On Wed, Sep 30, 2009 at 2:13 PM, Michael I. Lichter
<[email protected]> wrote:
> If you're on Unix/Linux or use Cygwin or the equivalent you can include a
> distinctive header in each file that includes the name of the file and use
> -egrep- and -tail- to locate the name of the last do file that began
> executing. So, your header might be
>
> // program: fritz.do -- compute the fritz statistic
>
> and you would run
>
> !egrep '// program: ' master.log | tail -1
>
> which would identify the failed file. It wouldn't be too difficult to write
> a Stata program to do the same thing using -file read-.
>
> Michael
>
> raoul reulen wrote:
>>
>> I run one master do file that runs ~100 other do-files. When I get an
>> error message I need to know in what do-file the error occured. Is
>> there an easy way in Stata to find out what the last do-file was
>> without having to scroll through the output?
>>
>> Thanks
>>
>> Raoul
>> *
>> *   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/
>>
>
> --
> Michael I. Lichter, Ph.D. <[email protected]>
> Research Assistant Professor & NRSA Fellow
> UB Department of Family Medicine / Primary Care Research Institute
> UB Clinical Center, 462 Grider Street, Buffalo, NY 14215
> Office: CC 126 / Phone: 716-898-4751 / FAX: 716-898-3536
>
> *
> *   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index