*! version 1.0.0 02/02/93 extrname utility; STB-13: dm13 program define _crcexna /* px fname mname lname sx af odd */ version 3.0 local px "`1'" local fname "`2'" local mname "`3'" local lname "`4'" local sx "`5'" local af "`6'" local odd "`7'" tempvar wrk quietly { /* embedded blanks are odd */ replace `odd'=cond(`odd',-1,101) if index(`fname'," ") replace `odd'=cond(`odd',-1,102) if index(`mname'," ") replace `odd'=cond(`odd',-1,103) if index(`lname'," ") /* Periods are sometimes `odd' */ gen byte `wrk'=index(`fname',".") replace `odd'=cond(`odd',-1,111) if `wrk'==1 | `wrk'>=3 replace `wrk'=index(`mname',".") replace `odd'=cond(`odd',-1,112) if `wrk'==1 | `wrk'>=3 replace `odd'=cond(`odd',-1,113) if index(`lname',".") } end exit /* values of odd: last digit is: 0 px 1 fname 2 mname 3 lname 4 sx 5 af 10. reserved 20. reserved 30. reserved 100. embedded blanks in name (1,2,3) 110 Periods in (odd) places (1,2,3) -1 multiple reasons above */