Hi all,

I have 29 .csv dataset, each dataset is for a year from 1990 to 2018, and I want to append all datasets. Non of the datasets specify the year, so I need to generate variable year for each dataset before appending. Also, each datasets have its own do file for creating value and variable labels. Before appending datasets, I first opened .csv dataset for year 1990 in Stata 16, generated the variable year=1990, ran the do file for value labels and then save it as .dta file under the name c_1990.dta. I did the same procedure for each year, so that I have 29 files with name c_`year'.
After creating these file, I used the following command for appending.

Code:
use c_2018
forval x = 1990/2017 {
    append using c_`x' 
}
There is a variable "cipcode" which is 6-digit code for instructional program in all datasets. However, after appending, I see that some of the cipcodes do not have value labels. In fact, all the values of cipcode for year 2018 have value labels, but for earlier years, some of the codes that is not included in year 2018, do not have value labels. How can I tell Stata to consider value labels for each datasets? do I have to run the do files that includes value labels for each year one by one after appending? The following dataset is just an example of the result I got after appending.

Code:
clear
input float year long cipcode
1990 50.0000
1990 47.0000-Mechanics and Repairers, General
1990 27.0000
1990 15.0000-Engineering Technology, General
1990 99.0000
2003 54.0101-History, General
2003 13.0488
2003 14.0301-Agricultural Engineering
2003 50.0799-Fine Arts and Art Studies, Other
2003     99     -Grand total
2018 43.0199-Corrections and Criminal Justice, Other
2018  05.0201-African-American/Black Studies
2018 50.0501-Drama and Dramatics/Theatre Arts, General
2018     99     -Grand total
end
Thanks.
Marjan