Statalist The Stata Listserver


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

st: RE: Saving global variables for future Stata sessions


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Saving global variables for future Stata sessions
Date   Wed, 14 Feb 2007 16:47:08 -0000

Communication is easier if you follow Stata's 
terminology. By "global variable" I guess you
mean "global macro". 

If you want to save global macro contents with
datasets I believe that you must do it indirectly. 

You mention .do files. A variant on that is to 
add global definitions to your profile.do file, 
or to have a file 

-------------------------- myglobal.do 
global foobar "foobar" 
global buzz "fuzz"
global answer = 42
-------------------------

and then to have within -profile.do- 
a command 

do myglobal 

Alternatively, save a global as a characteristic (good), 
or in a variable (poor style, but may be practical). 

Nick 
[email protected] 

Rachel
 
> Is there any program or built-in command that can do this. I'm looking
> for some way other than simply saving the macro declarations as a do
> file and running them each time I open a new session.

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