Skip to content

Commit

Permalink
Create UCI source in merge.dta
Browse files Browse the repository at this point in the history
  • Loading branch information
mpearce committed Aug 14, 2015
1 parent b0da7d6 commit 28e2e86
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/begin.do
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ program define cache_mergefile
save `merge', replace
}

* Create UCI source
import delimited "UCICountries.csv", clear case(preserve)
gen SourceNumericCode = UCINumeric
rename UCIAlpha SourceCountryCode
rename UCIName SourceLongName
rename Category Deprecated
gen Source = "UCI"
append using "`merge'"
save `merge', replace

* Align merge lists with UCI Country Codes and Names
import delimited "UCICountries.csv", clear case(preserve)
capture labmask UCINumeric, values(UCIName)
Expand All @@ -169,6 +179,7 @@ program define cache_mergefile
labmask UCINumeric, values(UCIName)
}
merge 1:m UCINumeric using `merge', keep(match ) nogenerate nonotes

compress
save "source/merge.dta", replace
end
Expand Down

0 comments on commit 28e2e86

Please sign in to comment.