Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Class system failure

From (Vince Wiggins, StataCorp)
Subject   Re: st: Class system failure
Date   Mon, 01 Mar 2004 23:13:59 -0600

Fred Wolfe <> writes that after turning on ado
program profiling -- set profiler on -- and running a do file he gets 
unexpected "class system failure" messages,

> Here is a Stata error I have not seen before.
> I -set profiler on-
> Then run a do file. I get the following:
> log:  C:\Statdata\lung\crlung1.log
> log type:  text
> opened on:  28 Feb 2004, 05:40:31
> class system failure
> Databank version set to 232h
> class system failure
> [...]
> class system failure
> Do file run on 28 Feb 2004 at 05:40:31
> class system failure
> <snip>
> I couldn't find it in the documentation (I hope I looked hard
> enough).
> After setting profiler off the program runs without problem.

The -profiler- command performs what computer scientists call profiling of
Stata programs, that is to say it accumulates the amount of time spent in each
program and optionally reports this time using -profiler report-.  I don't
think Fred overlooked anything in the documentation for -profiler-, especially
since it is a so-called undocumented command.  I say so-called because it is
among those commands we wrote for our own use, but thought that they were of
sufficient interest to some programmers that they deserved a help file (see,
-help undocumented- for more on what undocumented means and for other such

The help file documentation for -profiler- is sparse and does not note that
the profiler accumulates time counts in class system objects.  I suspect
that what has happened to Fred is that either his do file or one of the
programs run from the do file is invoking a command that clears the class
system, possibly -discard- or more likely -clear-.  With the class system
cleared the profiler can no longer find the locations where it was saving

If -clear- is being used, Fred could consider just dropping specifically what
needs to be dropped.  -clear- is a heavy-handed command that almost returns
Stata to its initial starting condition.  For example, not only is the dataset
dropped, but all constraints, returned results, matrices, and scalars are
dropped, and the dialog boxes discard their saved settings.

Having not seen Fred's programs, I am only guessing that -clear- is being
used.  If I am wrong, I would very much like to hear from Fred privately so we
can explore what is happening.

-- Vince

*   For searches and help try:

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