*! v0.0.1 2017-11-27 Scott Long

// list dta files click to use

capture program drop dtait
program define dtait
    version 13.0
    syntax [ anything] [ , ]

    local dtaspec : subinstr local anything ".dta" "", all
    if "`dtaspec'"=="" local dtaspec "*"

    local dtafiles : dir "`c(pwd)'" files "`dtaspec'.dta"

    display as text " "
    foreach file in `dtafiles' {
        local nspaces = 2
        di `"{space `nspaces'}{stata use `file', clear  :`file'}"'
    } // file loop

end
exit