*# var # Replaces invalid icd9 codes with missing ("") *! 29aug2007 program icd9clear version 9.2 syntax varlist local i 1 local test: char _dta[note`i'] while ~mi("`test'") { local test: char _dta[note`++i'] } foreach v of varlist `varlist' { tempvar bad icd9 check `v', g(`bad') replace `v'="" if `bad' capture drop `bad' } notes drop _dta in `i'/`=`i'+100' //as of 9/20/06 there are 32 icd9 notes end