Hi, I have been trying to loop over some file names.
I have something like this:
foreach s of num 2007/2015{
clear all
use "$path/Matricula Universitaria/`s'_1C.dta", clear
merge m:m mrun using "$path/Matricula Universitaria/`s+1'_2A.dta", keep(match master) force
}
For instance, I want to match the database 2007_1C with the 2008_1A but I can't get the `s+1' to work. If I do that, it merges the 2007_1C with the 2007_1A
If I write
merge m:m mrun using "$path/Matricula Universitaria/`s'+1_2A.dta", keep(match master) force
I get the following error message:
file C:.../Matricula Universitaria/2007+1_2A.dta not found
Any help is welcome! Thanks
Related Posts with Loop over file names
Compute intervals between datesI am trying to compute inter-pregnancy intervals (in months) and have the variables to compute this …
how to run a DEA meta frontière in stata?I want to implement a meta boundary model to take into account the specificity of each group in the …
Endogeneity in non-structural modelingHello Stata users, Can you pleas tell me how we can adress endogeniety in non-structural modeling? …
Rationale behind set seed/seedI have been coming across the "set seed" command while generating random numbers and while reporting…
How to check if variables in varlist are registered as regular or imputedI'm trying to write a loop that iterates through every single variable in a varlist and performs dif…
Subscribe to:
Post Comments (Atom)
0 Response to Loop over file names
Post a Comment