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, statalist.org is already up and running.


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

Re: st: Using macros and batch running.


From   Daniel Feenberg <feenberg@nber.org>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Using macros and batch running.
Date   Sat, 2 Jul 2011 08:40:46 -0400 (EDT)


On Sat, 2 Jul 2011, Adrian Sayers wrote:


I am trying to do.
forvalues i = 1/2 {
winexec "\\myserverstata11\StataMP.exe" -e include batch.do
}


Where batch.do contains
clear all
set obs 10000
gen id = _n
gen var1 = `i'
save batch`i'.dta , replace

i seem to have trouble transferring the local macros in one activation of stata to another activation.

Have you tried writing the macro defining statements to a file and "including" them the do file? See "help include"



Daniel Feenberg
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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