Bookmark and Share

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

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

Re: st: RE: Figure out in which do-file an error occurred

From   [email protected] (Brendan Halpin)
To   [email protected]
Subject   Re: st: RE: Figure out in which do-file an error occurred
Date   Wed, 07 Mar 2012 19:00:18 +0000

A simple but tedious strategy would be to put a line like this

-di "Beginning"- 

at the start of each do-file. 

If you run the master file, it will stop at the first error and you can
backtrack to the most recent "Beginning" statement. 

I cope with large projects by using "make", a utility which comes with
Unix systems. Alternatively, you could use a script file (something.bat
in Windows, a shell-script file in Unix-like systems). This involves
using Stata in batch mode. However, since Stata batch jobs tell the
operating system they have completed successfully even if there has been
a Stata error, these script files will continue regardless even when
an error occurs in an earlier do-file. I wrap the call to Stata in a
script file which searches the log file for errors. I describe the
system in more detail at

Brendan Halpin,   Department of Sociology,   University of Limerick,   Ireland
Tel: w +353-61-213147  f +353-61-202569  h +353-61-338562;  Room F1-009 x 3147
mailto:[email protected]    ULSociology on Facebook:         twitter:@ULSociology
*   For searches and help try:

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