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

Re: st: Stepping through do file

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


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.


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

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


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
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:
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
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.

*   For searches and help try:

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