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?
String variable quarterly timeHello everyone, First of all, I have learned a lot from this forum. However, I could not find the a…
Creating cohorts- pseudo panel dataHi, I'm using 3 rounds of cross sectional NSSO data and would like to generate a pseudo panel datase…
Cohort variableHello! I am using data about households and I am interested in analyzing homeownership and mortgage …
Calling a program whose name is a localHi all, My question is quite straightforward I guess but I did not find any answer on the web. Let…
Randomly generating an ID which is same for duplicates of an observationThere are 4 states coded 1,2,3 and 4. Within each state, I have generated a unique id to identify mo…
Subscribe to:
Post Comments (Atom)
0 Response to Import mulitple sas7bdat files into stata with a loop?
Post a Comment