Bookmark and Share

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


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

Re: st: Executing do-file yields no output


From   Neil Shephard <[email protected]>
To   [email protected]
Subject   Re: st: Executing do-file yields no output
Date   Mon, 9 May 2011 13:43:07 +0100

On Mon, May 9, 2011 at 12:50 PM, George Mailbox
<[email protected]> wrote:
>
> I used the command "do dofilename" and I expected the command window
> and the log-file to display the commands, regression estimates and
> post-estimation test results. However, they only display the commands
> exactly the way they are in the do-file, each line preceded by ">",
> yet no regression estimates and no post-estimation test results.

This suggests to me that at some point in your do-file you open a
comment ("/*  ") but do not close it.

> It
> looks like stata is just going through the commands but not executing
> them. I tried including an error to test whether it spots it and it
> did!
>
> "dir" tells me that the do file and the data file are in the same directory.
>
> The do-file (98KB) is structured as follows:
>
> ##############################
>
> clear all
>
> capture log close
>
> set more off
>
> version 10.1
>
> use  filename.dta
>
> log using filename.log, text replace
>
> command1
>
> command2
>
> .
> .
> .
>
> log close
>
> set more off
>
> exit
> ##############################
>

But thats not _exactly_ your do-file is it, because you've stripped
out the commands and comments and put in 'command1' 'command2' .... so
myself and others can not possibly look at your code and start to help
deduce where the problem is.  As per the FAQ "Post your code" (see
http://www.stata.com/support/faqs/res/statalist.html#comment).

> The only solution I could come up with would be stripping my do-file
> of all comments and running it through the command window by copying
> and pasting chunks. This defeats the purpose of a do-file though.

Thousands of people work with hundreds of thousands (millions) of
do-files regularly, they do work, but you've made a mistake somewhere
and without _exact_ details of what code you have myself and others
can only guess.

> It's a puzzling problem I have been spending days researching online,
> even my colleagues in the office hadn't seen Stata handling a do-file
> in such a strange way.

If I were a gambling man I'd wager its my above suggestion of open,
but not closed comment, but thats just a guess as I can't see your
code.

Neil

-- 
“Truth in science can be defined as the working hypothesis best suited
to open the way to the next better one.” - Konrad Lorenz

Email - [email protected]
Website - http://kimura.no-ip.org/
Photos - http://www.flickr.com/photos/slackline/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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