*! Version 1.0.0 (recast2) from Stata version 2.1.2 21nov1997 of recast.ado * modified by f wolfe 9/2/1999 - add a force option program define recast2 * touched by jwh version 4.0 local type `1' mac shift local varlist "req ex min(1)" local options "Force" parse "`*'" parse "`varlist'", parse(" ") tempvar RECAST local rc 0 while "`1'"!="" { capture drop `RECAST' capture gen `type' `RECAST' = `1' if _rc { di in red "`1': `type' invalid" local rc 109 } else { quietly count if `1'~=`RECAST' & "`force'" == "" if r(N)>0 { di in gr "`1': " in ye r(N) in gr /* */ " values would be changed; not changed" } else { local varl : variable label `1' label var `RECAST' "`varl'" capture confirm string var `RECAST' if _rc { local val : value label `1' label val `RECAST' `val' local fmt : format `1' format `RECAST' `fmt' } char rename `1' `RECAST' drop `1' rename `RECAST' `1' } } mac shift } exit `rc' end