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

st: looping across an unknown number of columns


From   Jason Rachlin <[email protected]>
To   [email protected]
Subject   st: looping across an unknown number of columns
Date   Tue, 10 Aug 2004 11:29:04 +0100

program then loops over these dates performing a function.  I'd like to loop
until I hit the last date in my dataset which will change each time I run the
program depending on the size of the dataset.  Can someone please recommend an
efficient way to identify my last column so I can define NumDays?

local NumDays = ?
local i = 1
while `i' <= NumDays {
    ...
}

cheers!

*
*   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