Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Stepping through do file


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   Re: st: Stepping through do file
Date   Sat, 29 Mar 2008 19:31:38 -0400

Buzz-

Oh well... I think I mentioned that stepdo would have problems with more complicated files -- commands that continue across multiple lines was the first example I thought of, I'm sure there are others.

By the way, 1) the local macro hdl is defined in the tempname statement; 2) command abbreviation should have no impact since the ado just echoes each line of the do file as a command -- so I can't figure out your error unless there is something else on the line; 3) perhaps the execution of multiple lines issue is related to setting more off?

It probably isn't easily fixed to deal with the complex set of nested do files that you have.

Michael

p.s. the thank-you was certainly welcome, if perhaps undeserved since my help hasn't solved your problem :)


----- Original Message ----- From: "Buzz Burhans" <[email protected]>
To: <[email protected]>
Sent: Saturday, March 29, 2008 7:11 PM
Subject: RE: st: Stepping through do file



Michael,

My apologies for my garbled earlier thank-you email - I was too rushed and
thus unclear, I should have been more careful.

I think the -stepdo- approach is not going to work -I am not suggesting you
refine it, but only wanted to let you know, and hope that the exchange might
stimulate StataCorp to consider adding the capability to step through -do-
files line by line while keeping the do file active.

Anyway, I have tried -stepdo- and can't seem to get it to run correctly.

The first run failed because there was a line at the top of the file
commented out as // text...; the results-screen display after running
-stepdo- with that line in the file were:

. stepdo using ...path...TDStages_History1v2.do
// ...path...TDStages_History1v2.do
unrecognized command:  / invalid command name
r(199); t=0.00 18:36:17


I think that Stata is unable to handle the -//-, as reported earlier in this
statalist post: http://www.stata.com/statalist/archive/2005-05/msg00115.html
Since my -do- files contain frequent comments, this probably renders this
approach unusable.


I later removed the commented out line, and it did two unexpected things;
1st, it ran multiple lines of the -do- file without stopping; second, it
failed on "cap nois log close":

. stepdo using
C:\ViewsVT\Stata\TDStages\HistoryReports\TDStages_History1v2.do
version 9.2
                       cap nois log close
unrecognized command:                   cap invalid command name
r(199); t=0.00 18:48:42

Seems it somehow doesn't recognize abbreviated commands like cap / -capture-
and disp / -display-

I suspect that the running of multiple lines instead of single lines could
be that the macro `hdl'  in the -stepdo- code does not seem to be identified
-but I am not sure.

Thanks very much for this.  I am going to try the -addpause- approach now.

Buzz
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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