How to Submit a Do-file in Batch Mode

The benefits of batch mode are many:

  1. Your code is processed faster.
  2. Your log and output windows are automatically saved in *.log and *.lst files.
  3. Every time you submit your program you know you are starting off with a clean slate.
  4. All your friends will think you're cool.


In Stata your results window is automatically saved to an ASCII text log file.  You can choose to have your results saved in a *.smcl file if you use the log using command in your do-file and specify a filename that does not have the extension of ".log".  The smcl file documents the results window down to the colors the text is printed in.  To do this Stata uses smcl tags which are a lot like html tags.  The only useful way to view this file is to use Stata's viewer.  If you specify that you want your file to be saved as a *.log file, then it will be saved as a normal ASCII text file without the smcl tags.


SAS

Stata

In Linux/UNIX at a prompt type:
sas myprogram.sas 
In Linux/UNIX at a prompt type:
stata -b do mydofile.do
In Windows right-click on the program file listed in the folder that you want to submit and choose "Batch Submit". In Windows you right-click on the do-file listed in the folder that you want to submit and choose "batch" if it is available.  If it is not listed, you can add the following to your folder options file types listing for files that end in ".do":
C:\Stata\wstata.exe /m40 /b do "%1" 
" /m40 " sets the memory to 40 megabytes.




Back to Main Page



Questions or comments?
  Send them to Dan Blanchette ()