Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: Unable to create local macro in modified ado-file (xtreg_fe.ado)

From   Richard Williams <>
Subject   Re: st: Unable to create local macro in modified ado-file (xtreg_fe.ado)
Date   Mon, 16 Jan 2012 23:39:49 -0500

At 07:36 PM 1/16/2012, Bert Lloyd wrote:
Hello all,

Thank you very much for the discussion.

Regarding Nick Cox's valuable suggested partial test (macrotest), that
and other similar tests work fine in ado-files that I create myself
from scratch, as well as others borrowed from co-workers, etc. This
problem has only occurred when attempting to modify Stata ado-files.

One other tidbit: Your original code works when version is set to 7 but not 6. Further, this code works:

version 6
local mylocal Hello
noisily di      "*****************"
noisily di      "local my_test_local contains"
noisily di "`mylocal'"
noisily di      "*****************"

Why? The whatsnew file for Stata 7 says "Stata now allows names to be up to 32 characters long. That includes variable names, label names, macro names, and any other name you can think of." I don't know what the limit was in V 6 -- 7 characters maybe? -- but my_test_local was probably too long of a name. Make your macro names shorter, like I did above, and I think your code will work.

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index