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
Related Posts with Import mulitple sas7bdat files into stata with a loop?
Painel dataHi I'm with a doubt when I do a painel data. The estimations of my B's in re and fe aren't differen…
ologit or melogit or just regress?I have a continuous variable 90-day death rate at the hospital level. In the database, there are 100…
Looping over files with slightly different names in different foldersHello, I previously posted code in a thread, and with the help of a couple Statalist users came up …
Can I control for covariates with a pca analysis?I am performing a principle component analysis with the between subject variable of fall status (non…
Using estpost and esttab for mutli-level data summary statisticsHello, I want to complete summary statistics for my multilevel data - countries (level 2) households…
Subscribe to:
Post Comments (Atom)
0 Response to Import mulitple sas7bdat files into stata with a loop?
Post a Comment