Hello
I have 524 sas files I would like to import as dta files, ex.
bef201012.sas7bdat
bef201112.sas7bdat
bef201212.sas7bdat
faik2010.sas7bdat
faik2011.sas7bdat
faik2012.sas7bdat
ind2010.sas7bdat
ind2011.sas7bdat
ind2012.sas7dat
etc,
My code looks like this:
local filenames: dir . files "*sas7bdat"
foreach file of local filenames {
import sas using "`file'"
save `file'.dta, replace
}
but it doesn't seems to work very well? Is there anybody that can help me correct my code
Kind regards Frank
0 Response to Import mulitple sas7bdat files into stata with a loop?
Post a Comment