*! v0.1.0 2018-08-03 Scott Long
* v0.0.1 2017-11-27 Scott Long

//  dtait.ado: list dta files in working directory; click to use
//  jslong@iu.edu - Scott Long

program define dtait
    version 13.0
    syntax [ anything]

    local filespec : subinstr local anything ".dta" "", all
    if "`filespec'"=="" local filespec "*"
    local filelist : dir "`c(pwd)'" files "`filespec'.dta"

    foreach file in `filelist' {
        display `"{stata use `file', clear  :`file'}"'
    }

end
exit