Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: How to get the variable name


From   "Renzo Comolli" <[email protected]>
To   <[email protected]>
Subject   Re: st: How to get the variable name
Date   Fri, 18 Jun 2004 02:20:49 -0400

Dear Maoyong,

I am not sure what you are asking about, but if you are asking to perform
the same operation on all variables, then do the following

foreach v of varlist _all {
 command referring to `v'
}


Best,
Renzo

----------------------------------------------------------------------------
----
*From   "Maoyong Fan" <[email protected]> 
To   "statalist" <[email protected]> 
Subject   st: How to get the variable name 
Date   Thu, 17 Jun 2004 22:58:12 -0800 

----------------------------------------------------------------------------
----

Dear Friends,

	I just wonder how can I get the list of varibale name automatically
instead of looking at describe list.  If I can get the list of the variable
name and store them into a local variable, I could use "foreach var in local
var" to do data management on each variable.  Because I have do deal with
more than 100 stata data files and do some data management for each data
file.  Using loop will same a lot of time than do that manually.	

Warm regards,

Maoyong Fan 	


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index