I'm trying to write a loop to append the individual datasets for each report, e.g., r1_d1 and r1_d2 will be appended. However, the following code doesn't work as intended:
Code:
local reports "r1 r2"
local dates "d1 d2"
foreach r of local reports{
tempfile `x'
save `x', emptyok
foreach d of local dates{
append using "`r'_`d'"
save "`x'", replace
}
}
0 Response to How to fix this loop to append files?
Post a Comment