A similar problem came up only yesterday. You need to use compound
double quotes in defining your macro.
Nick
[email protected]
Sutton, Bennett W.
Seems that stata 10 is having a problem reading the first element of my
local with embedded spaces:
. local PrivIssuer "Finance vehicle-Priv sector
bank/finance" "Finance vehicle-Priv sector indust/util" /*
> */ "Private Other" "Private sector bank"
"Private sector finance" "Private sector industrial" /*
> */ "Private sector utility"
. foreach type of local PrivIssuer {
2. display "`type'"
3. replace issuertype2 = 1 if issuertype ==
`"`type'"'
4. }
Finance
(0 real changes made)
vehicle-Priv
(0 real changes made)
sector
(0 real changes made)
bank/finance
(0 real changes made)
Finance vehicle-Priv sector indust/util
(102 real changes made)
Private Other
(3 real changes made)
Private sector bank
(1178 real changes made)
Private sector finance
(307 real changes made)
Private sector industrial
(723 real changes made)
Private sector utility
(197 real changes made)
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/