*! version 1.0.0   12jan2016 | daniel lewis | save variable labels for later use

capture program drop savemylabels
program define  savemylabels

* version 12

global savevardir `c(pwd)'
tempname savevar
file open `savevar' using "$savevardir/savevarlabel.do", write replace
file write `savevar' `"*This is a file to save and later reuse variable labels"'
file close `savevar'
file open `savevar' using "$savevardir/savevarlabel.do", write append

foreach X of varlist _all {
              local label : variable label `X'
			  file write `savevar' _n `"capture label var `X'  "' `""`label'""'
}
file close `savevar'

end

exit