Stata in batch mode and log file

Let's say I have the following folder structure.

/foo /bar1 code.do /bar2

I want to run Stata in batch mode and create a log file inside / foo / bar 2. What kind of batch code do I need to execute?

I will give you examples that I tried and it did not work. Now the log file is created as stata.log inside / foo. Also, I would like to run Stata in batch mode with -b and not see all the output in my GUI.

stata-se < "/foo/bar1/code.do" > "/foo/bar2"

stata-se "/foo/bar1/code.do" "/foo/bar2"

stata-se do "/foo/bar1/code.do" "/foo/bar2"

stata-se -b do "/foo/bar1/code.do" "/foo/bar2"

+4
source share
2 answers

Both methods work for me. Below are my exact terminal commands after creating your sample directories:

Method 1

$ stata <  /home/roberto/Desktop/foo/bar1/code.do > /home/roberto/Desktop/foo/bar2/code.log

Method 2

$ cd /home/roberto/Desktop/foo/bar2
$ stata -b /home/roberto/Desktop/foo/bar1/code.do

, 2 Stata . Stata.

+1

- do .

log using /home/roberto/Desktop/foo/bar2/code.log, replace

,

0

Source: https://habr.com/ru/post/1626046/


All Articles