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: exact row in which error occurs

From   Daniel Feenberg <>
Subject   Re: st: exact row in which error occurs
Date   Thu, 24 Nov 2011 07:22:59 -0500 (EST)

On Thu, 24 Nov 2011, Nick Cox wrote:

Stata doesn't work in this way, partly because do-files can and
usually do call other do-files, ado-files, commands, functions, etc.,
and a row number -- presumably meaning file line number -- would not
have very much meaning in many instances, and/or would refer to a line
in code that is proprietary and so hidden from you.

That would be called a "traceback" and I remember it in IBM Fortran G before GUI debugging displaced it. The traceback would look something like:

   illegal command at line 37 of subroutine SUB2

   called from line 21 of subroutine SUB1

   called from line 15 of MAIN

Other compilers gave additional information for each call, such as the value of scalar variables. These were very useful in debugging and had no runtime CPU overhead. (There was some memory used). The alternative with Stata is to -set trace on-, but sometimes that produces a prodigious amount of output. As it is, it is often time consuming to associate a generic error message such as "no variables found" with a particular (a)do file statement in a long program.

Daniel Feenberg
*   For searches and help try:

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