Statalist The Stata Listserver


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

Re: st: running do files from unix -- can we pass values to the do file?


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: running do files from unix -- can we pass values to the do file?
Date   Sat, 18 Feb 2006 12:08:29 -0500

At 11:37 AM 2/18/2006, Pablo Mitnik wrote:

An elegant and efficient alternative would be to be able to pass the values of the locals to the do file when running it, something like:

stata -b do dofile localvalue1 localvalue2 &

Of course, this cannot be done this way.
Come to think of it, you don't even need the -args- command. Just have your do file be something like this:

use "http://www.indiana.edu/~jslsoc/stata/spex_data/ordwarm2.dta";
ologit warm `1' `2', nolog

i.e. refer to the parameters as `1', `2', etc.

If there were inconsistencies across runs, e.g. sometimes the number or type of parameters would be different - check out the -syntax- command, as it gives you more flexibility if you need it.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* 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