Michael wants to replace something if it occurs at a certain position.
First determine whether it does, then if it does, replace it:
g mcc2= cond(substr(mcc,3,2)=="99",subinstr(mcc,"99","01",1),mcc)
Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html
*
* 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/