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

st: Passing a local variable into a subsequent do-file

From   Bryce Mason <>
Subject   st: Passing a local variable into a subsequent do-file
Date   Wed, 12 Aug 2009 16:22:47 -0700

Dear STATA Gods,

Let me predicate this on the fact that I am by no means a great stata programmer. I'm constantly learning new things, so forgive my ignorance. I doubt I am going about things in the best way.

I would like to know whether it is possible to pass a local variable to a subsequent do file called from my main do file. That is, I often call other do-files from a main file and use them like subroutines. It keeps my code shorter.

Recently, however, I ran into a situation where the do file I am calling doesn't remember the local macro names I assigned in the main program. The local macro name in question stems from a foreach loop, so I can't use global assignment.

Thank you for any help.

Yours Sincerely,


Bryce Mason, Ph.D.
Director of Institutional Research
Loyola Marymount University
1 LMU Drive | Los Angeles, CA 90045

b:	4823 University Hall
w:	(310) 258-8838
f:	(310) 338-1841

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index