Code:
clear
set more off
local flist: dir "." files "*.dta"
use NHIS_1986_MORT_2011_PUBLIC     //is there a way to run the code without specifying the using dataset?
local mort = 0
foreach fname of local flist {
    local ++mort   
    tempfile temp`mort'
    save  "`temp`mort''"
}    
forval i = 1/`mort' {
  append using "`temp`i''"
}
0 Response to Generate with tempfiles
Post a Comment