Statalist The Stata Listserver


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

st: Re: multiple identical .do files


From   "R.E. De Hoyos" <[email protected]>
To   <[email protected]>
Subject   st: Re: multiple identical .do files
Date   Thu, 23 Mar 2006 23:21:59 -0000

Paul,

Try the following:

Save the do-file with the procedures as, say, paul.do. Open another do-file:

**********************************************
log using results
local fnames file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 //the names of your 10 files
foreach n of local fnames {
clear
use "C:\data\\`n'.dta" //or where ever you data is stored
do "C:\paul.do" //rute where you saved paul.do
}
**********************************************

Rafa


----- Original Message ----- From: "paul d jacobs" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 23, 2006 10:44 PM
Subject: st: multiple identical .do files



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/

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