Statalist


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

Re: st: current do file if error message


From   "Michael I. Lichter" <mlichter@buffalo.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: current do file if error message
Date   Wed, 30 Sep 2009 14:13:51 -0400

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. <mlichter@buffalo.edu>
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/



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