Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: multiple identical .do files


From   "Stas Kolenikov" <[email protected]>
To   [email protected]
Subject   Re: st: multiple identical .do files
Date   Thu, 23 Mar 2006 22:41:56 -0600

In your do-files, you can use macros `1' `2' etc:

do mycoolfile data1

and then in your mycoolfile.do you can say something like

log using `1', replace
use `1', clear
blah-blah-blah
exit

I think this should be explained in more details in either [P] or [U],
and I am pretty sure I learned that in one of NetCourses some 8 years
ago :))

On 3/23/06, paul d jacobs <[email protected]> wrote:
> Hi Stata users:
>
> My issue (which I could not find an answer to in the
> archives) has to do with a single .do file I would
> like to run on 10 datasets which all have the same
> variable names.  Essentially, I am looking for a macro
> or loop program that could run the .do file on all ten
> datasets without having to update 10 separate .do
> files each time I make changes to the original.
>
> More specifically, right now I have 10 .do files and
> ten datasets.  Each time I change a command, I have to
> resave the file ten times so that it corresponds to
> each dataset, run each file, and then use each .log
> file to find the particular statistics I want.
>
> Thanks very much for your assistance.
> Paul Jacobs
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> *
> *   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/
>


--
Stas Kolenikov
http://stas.kolenikov.name

*
*   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