Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Macro question

From   David Kantor <>
Subject   Re: st: RE: Macro question
Date   Tue, 15 Mar 2005 11:44:49 -0500

At 10:06 AM 3/15/2005 -0600, Fred Wolf wrote:
Thanks Nick and Nick.

I modified the code slightly for my application, and I get the same error with the two suggested methods. Suggestion?

local vlist: list clean vlist
local olist : subinstr local vlist `" "' `"", ""' , all
local olist `""`olist'""'
di "`olist'"

callparmby "reg totcost03 age sex `var'",fwrelabel pformat(%9.3f) eformat(%9.1f) vlist(plaghaq_ plaghaq2 plagpas)
plaghaq_disability", "plaghaq2", "plagpas"" invalid name

Try compound quotes on the di.
di `"`olist'"'

But also be careful in passing such macros as parameters. Quotes can get stripped.
Similarly, when handling such macros in general, always use compound quotes, and watch out for places where quotes get stripped -- at least the outermost quotes.

-- David

David Kantor
Institute for Policy Studies
Johns Hopkins University
* For searches and help try:

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