Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

RE: st: run stata in a batch mode using do file

From   tashi lama <>
To   <>
Subject   RE: st: run stata in a batch mode using do file
Date   Wed, 19 Sep 2012 21:09:37 +0000

Ouch.. I actually got this. Is it a good thing?? Stata does run adofile in a batch mode. 

/* begin adofile try.ado */
program try
   syntax, firm(int)
   qui odbc query indigo
   odbc load, exec("select date(read_date) as date, count(*) as hits from readership where source_id=`firm' and date(read_date) between '2011-01-01' and '2011-05-01' group by date")
   destring hits, replace
   tsset date
   tsline hits

In Shell
$ stata -b try ", firm(93619)"    //yields try.log 

Stata and Shell both are happy. I hope there aren't any catches. 


> From:
> To:
> Subject: Re: st: run stata in a batch mode using do file
> Date: Wed, 19 Sep 2012 18:16:13 +0100
> On Wed, Sep 19 2012, tashi lama wrote:
>> Out of curiosity, why is it that stata can't run ado file directly in a
>> batch mode? It is very inconvenient for someone like me who prefer to
>> write adofile than a do file because it is faster and better in
>> design(arguments arent positional).
> An ado-file simply defines and makes available a command. It doesn't
> "do" anything, in the sense of carrying out actions on data or creating
> output.
> Brendan
> --
> Brendan Halpin, Department of Sociology, University of Limerick, Ireland
> Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F1-009 x 3147
> ULSociology on Facebook:
> twitter:@ULSociology
> *
> * For searches and help try:
> *
> *
> * 		 	   		  
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index