I have around 40 files that I would like to append together. However, two variables named a12 and a13 are problematic because they can take three different shapes :
- Numeric
- String with only numeric values
- String with alphanumeric values
I guess the fastest way to convert them would be to turn the numeric a12 and a13 variables into string variables, but when running the code:
I get the following result :
Can't I use the replace option for these variables ? If not, what would be an efficient programming to turn all the variables into string ones?
- Numeric
- String with only numeric values
- String with alphanumeric values
I guess the fastest way to convert them would be to turn the numeric a12 and a13 variables into string variables, but when running the code:
Code:
foreach co of global countries{
use ``country'_finaldata', clear
foreach appendvar of varlist a12 a13 {
tostring `appendvar', replace
}
save ``country'_finaldata', replace
}
Code:
a12 has value label; no replace a13 has value label; no replace

Comment