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

Re: st: stata in batch mode


From   [email protected] (William Gould)
To   [email protected]
Subject   Re: st: stata in batch mode
Date   Mon, 29 Jul 2002 07:45:40 -0500

Chris Rohlfs <[email protected]> writes, 

> i'm trying to run a stata *.do file in batch mode from a unix shell script.
> my problem is that the stata intro screen appears in my nohup.out file &
> freezes on a "--more--" cue before my program has a chance to run & execute
> the "set more off" line.  does anybody know how to get around this feature?

I suspect -q is the option you are looking for.  

        $ stata -q 

tells Stata to come up and suppress displaying the opening screen.

Stata for Unix has some other "batch" features worth knowing about.  The 
first is that, if the output is redirected in a way that Stata can detect, 
Stata knows you are trying to do something "batchy" and so turns of --more--
for you:

        $ stata -q < input.do > output.log 2>&1 

Chris is obviously using Unix's -nohup-, which does redirection -- but it 
does it in a way that Stata cannot detect, so rather than type 

        $ nohup stata -q < input.do & 

I suggest Chris type 

        $ nohup stata -q < input.do > output.log 2>&1 & 

Another useful batch feature is -b, where the b stands for batch.  This is
what I use.  When you type

        $ stata -b do myfile 

Stata automatically creates myfile.log for the output and routes the output 
there.  Chris could type 

        $ stata -b do myfile & 
or
        $ nohup stasta -b do myfile & 

Anyway, for a complete list of Stata-for-Unix startup options, type 

        $ stata -h

-h tells Stata to show the help display for the stata invocation command 
rather than launching itself.

-- Bill
[email protected]
*
*   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