Hi, I am trying to append files from the same dataset but different years.
This is my line of code in my do file:
use "C:\Users\rjohn123\Documents\hh02dta_b3a\iiia_tb.d ta", clear
keep tb21_2 tb02_1
append using "C:\Users\rjohn123\Documents\hh05dta_b3a\iiia_tb.d ta", nol
append using "C:\Users\rjohn123\Documents\hh09dta_b3a\iiia_tb.d ta", nol
sort folio ls
save "C:\Users\rjohn123\Documents\employementappend.dta ", replace
keep tb21_2 tb02_1
This is my output:
. use "C:\Users\rjohn123\Documents\hh02dta_b3a\iiia_tb.d ta", clear
(VERSION (ene 19))
. keep tb21_2 tb02_1
. append using "C:\Users\rjohn123\Documents\hh05dta_b3a\iiia_tb.d ta", nol
(note: variable tb02_1 was byte, now float to accommodate using data's values)
(note: variable tb21_2 was long, now double to accommodate using data's values)
. append using "C:\Users\rjohn123\Documents\hh09dta_b3a\iiia_tb.d ta", nol
variable tb20_1 is byte in master but str1 in using data
You could specify append's force option to ignore this numeric/string mismatch. The using variable would then be treated as
if it contained numeric missing value.
r(106);
end of do-file
r(106);
Can someone please tell me step-by-step how to solve this problem with the append command that I am having?
This is my line of code in my do file:
use "C:\Users\rjohn123\Documents\hh02dta_b3a\iiia_tb.d ta", clear
keep tb21_2 tb02_1
append using "C:\Users\rjohn123\Documents\hh05dta_b3a\iiia_tb.d ta", nol
append using "C:\Users\rjohn123\Documents\hh09dta_b3a\iiia_tb.d ta", nol
sort folio ls
save "C:\Users\rjohn123\Documents\employementappend.dta ", replace
keep tb21_2 tb02_1
This is my output:
. use "C:\Users\rjohn123\Documents\hh02dta_b3a\iiia_tb.d ta", clear
(VERSION (ene 19))
. keep tb21_2 tb02_1
. append using "C:\Users\rjohn123\Documents\hh05dta_b3a\iiia_tb.d ta", nol
(note: variable tb02_1 was byte, now float to accommodate using data's values)
(note: variable tb21_2 was long, now double to accommodate using data's values)
. append using "C:\Users\rjohn123\Documents\hh09dta_b3a\iiia_tb.d ta", nol
variable tb20_1 is byte in master but str1 in using data
You could specify append's force option to ignore this numeric/string mismatch. The using variable would then be treated as
if it contained numeric missing value.
r(106);
end of do-file
r(106);
Can someone please tell me step-by-step how to solve this problem with the append command that I am having?
Comment