<>
Example:
**************
sysuse auto, clear
levelsof rep78
foreach num in `r(levels)'{
di `num'
}
**************
Note that the -by- prefix can replace these loops in many cases...
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kushan Thakkar
Sent: Mittwoch, 14. Oktober 2009 00:53
To: [email protected]
Subject: st: foreach loop over a column
I have a column name permno in my dataset. It is a numerical column,
and I want to loop over it. This is what I did:
foreach num in permno {
// do something
}
but this is not working.. what am i doing wrong?
Thanks
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/