Hello folks, I am new to Stata and could use a bit of guidance as Google has not helped!
I have a data set of about 100 tables and need to run the same commands on every table. I would like to know if I can get Stata to generate code from code, for example using SQL for a relational database to generate "tab tableA tableB, row column" for every table where tableB is always the same I would use something like this to generate 100 lines of code by just writing one line of code:
select ||'tab '|| table_name ||' tableB, row column' from user tables;
and this would produce code which I can then run, e.g.
tab tableA tableB, row column
tab tableB tableB, row column
tab tableC tableB, row column
tab tableD tableB, row column
etc etc
Hopefully that made some vague sense?! If something similar is possible in Stata could somebody please point me in the right direction.
Many thanks,
Ian.
I have a data set of about 100 tables and need to run the same commands on every table. I would like to know if I can get Stata to generate code from code, for example using SQL for a relational database to generate "tab tableA tableB, row column" for every table where tableB is always the same I would use something like this to generate 100 lines of code by just writing one line of code:
select ||'tab '|| table_name ||' tableB, row column' from user tables;
and this would produce code which I can then run, e.g.
tab tableA tableB, row column
tab tableB tableB, row column
tab tableC tableB, row column
tab tableD tableB, row column
etc etc
Hopefully that made some vague sense?! If something similar is possible in Stata could somebody please point me in the right direction.
Many thanks,
Ian.
Comment