Statalist The Stata Listserver


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

st: global query


From   "Ingo Brooks" <[email protected]>
To   [email protected]
Subject   st: global query
Date   Thu, 19 Apr 2007 16:00:26 +0200

Dear all,

I have a problem using global macros:

. local Test "aut"
. sysuse `Test'o , clear

works fine and opens the auto.dta dataset. However,

. global Test "aut"
. sysuse $Testo , clear

gives the following error message:

invalid file specification
r(198);

I know that I could solve the problem at hand by introducing a local
macro as follows:

. global Test "aut"
. local Test "$Test"
. sysuse `Test'o , clear

Unfortunately, however, this is quite cumbersome and there are lots of
macros in my do-files which all begin with the same first part (in the
example above: "aut") but whose second part changes (the "o" in
"auto"). I need to use global macros because I have to exchange
information between several do-files and therefore cannot rely on
local macros.

Any help would be appreciated.

Best,
Ingo
*
*   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