Hi All,
I am new to loops, especially running them in parallel fashion. I want to change years in data files as well as number sets from files. I have no idea if I am doing this correctly.
Here is my code example.
local LIST 41 49 50 52 53 54 55 56 57 58 59 60
set trace on
forval i=0/4{
foreach in local LIST {
clear
cd "C:\Users\jsco131\Documents\extracts\RMS\201`i ’"
import delimited C:\Users\jsco131\Documents\extracts\RMS\201`i’\Mov ement_Files\5003_201`i’\50`LIST’_201`i’.tsv
merge m:1 store_code_uc using "C:\Users\jsco131\Documents\extracts\RMS\201`i’\st ores_201`i’.dta"
keep if _merge==3
drop _merge
save StoreData50`LIST’_201`i’.dta
}
}
set trace off
How do I fix this?
Thank you in adavance.
-Josh
I am new to loops, especially running them in parallel fashion. I want to change years in data files as well as number sets from files. I have no idea if I am doing this correctly.
Here is my code example.
local LIST 41 49 50 52 53 54 55 56 57 58 59 60
set trace on
forval i=0/4{
foreach in local LIST {
clear
cd "C:\Users\jsco131\Documents\extracts\RMS\201`i ’"
import delimited C:\Users\jsco131\Documents\extracts\RMS\201`i’\Mov ement_Files\5003_201`i’\50`LIST’_201`i’.tsv
merge m:1 store_code_uc using "C:\Users\jsco131\Documents\extracts\RMS\201`i’\st ores_201`i’.dta"
keep if _merge==3
drop _merge
save StoreData50`LIST’_201`i’.dta
}
}
set trace off
How do I fix this?
Thank you in adavance.
-Josh
Comment