Hello,
I wrote the following two simple statements in the same
do file. But when executed, the latter ('NG') returned
nothing, while the former ('OK') returned the desired
results:
----------
/*OK*/
l bonus if age == 58 & year ==2001
pause
l bonus if age == 59 & year ==2001
pause
/*NG*/
if age == 58 & year ==2001{
l bonus
pause
}
else if age == 59 & year ==2001{
l bonus
pause
}
----------
This may be a preliminary question, but I don't
understand why.this difference occurs.
If there is any syntax error in the latter statements,
Stata should stop and gives an error message. But
they are executed without stopping, which makes me
all the more perplexed.
Any suggestions welcome.
Thanks in advance.
K.I.
*
* 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/