data writing to dta and Rda