Hi all,
I was wondering how to successfully defining local macros beginning
with 0, since I think probably STATA automatically ignores the 0 in the
beginning of a local's expression.
my data set has following variables:
-----------
T0990802
T0991302
T0991802
T0992302
T0992802
T0993302
T0993802
T0994302
------------
I want to create new variables equal the value of 2006 subtracted by
T0990802, T0991302,... and T0994302.
I tried the following command:
------------------------------------------
local j=0802
forvalue i =1/8 {
g age`i'=2006-T099`j'
replace age`i'=2006-T099`j'
local j=`j'+500
}
end
-----------------------------------------
But STATA gives the error information :
" T099802 not found
r(111); "
I guess it's probably because STATA treats "local j=0802" as "local j
=802". How could I make the 0 in 0802 not ignored?
Thanks for your time!
Man Jia
*
* 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/