Loop through files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Loop through files

jfca283
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hello
I need something very simple, which i couldn't do in spss.
I need to declare a list of files, .dat and .xls. They are over 15.
Then i need to run the DO file which is
############
cd /home/juan
local filelist: dir . files "*.dta"
foreach file of local filelist {
use "`file'", clear
gen fexpx=round(fexp)
tab Region PARENTESCO [fw=FACTx] if (CSE_ESPECIFICO==8 | CSE_ESPECIFICO==9)
}
#####################
It works if the table or cross analysis is small, but if i need a 15x15 table, i get
Too many values
How can i overcome that problem?
Thanks for your time and interest
Loading...