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

Re: st: current do file if error message

From   "Michael I. Lichter" <>
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: -- 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-.


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?


*   For searches and help try:

Michael I. Lichter, Ph.D. <>
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:

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