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?
Seconds base date & Differing units of analysis: Generate variable containing differences between first and last second of a unitDear all, I am trying to work my way into stata and I read a lot about how to build differences, bu…
Duplicates HelpI'm starting a new thread (old one was: https://www.statalist.org/forums/for...ific-duplicate) but I…
STATA commands for PSTR modelHi Team Can STATA 14 run PSTR model? If it does can someone assist with the commands please. …
Out-of-sample R2 forecastingHi everyone. Im currently writing my thesis and got advised to compare In-sample vs Out-of-sample p…
Panel data regression with high coefficients valuesDear All I have estimated a panel regression with command ' xtreg, fe cluster(id)'. (22 panels and …
Subscribe to:
Post Comments (Atom)
0 Response to Import mulitple sas7bdat files into stata with a loop?
Post a Comment