Hello I am trying to append some files using the command below
forvalues year =96/05 {
use file_year_`x'.dta
if `x' !=96 append using file_year_`x'.dta
save file_all_years.dta, replace
}
The trouble here is that the files beginning from the the year 2000 to 2005 are labelled as "00" to "05". I want to assume that logically stata will assume that from 00 to 05 the values are not consecutive as it should be when using the command “forvalues” so files are only appended up to the year 1999. How can I fix this problem?
forvalues year =96/05 {
use file_year_`x'.dta
if `x' !=96 append using file_year_`x'.dta
save file_all_years.dta, replace
}
The trouble here is that the files beginning from the the year 2000 to 2005 are labelled as "00" to "05". I want to assume that logically stata will assume that from 00 to 05 the values are not consecutive as it should be when using the command “forvalues” so files are only appended up to the year 1999. How can I fix this problem?
Comment