I want to merge one using file (which is an Excel file) onto the masterfile in Stata. Might be easy but I don't know how to save the Excel file into a dta file so that I am, in turn, able to merge the two data sets in Stata.
I have read about the xls2dta command but I'm not sure if I'm looking in the right direction.
You do not need to convert the file with a special command like
xls2dta. You just import it to Stata and save it in a temporary file in dta format and then you can merge that temporary file with your dta file.Here is a reproducible example. All you need to do to run this code is to update the folder path in the
localin the beginning of the code. You should be able to adapt the code in the "Solution" section to your code.