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

st: Limit of numlist

From   Alan Neustadtl <>
Subject   st: Limit of numlist
Date   Thu, 6 Oct 2005 09:56:53 -0400

I am trying to writre formatted text output from a Stata data file and
wrote a program based on the examples in the Stat manual and the UCLA
Web site (

Some of the code is shown below.  I am getting an error "invalid
numlist has too many elements  r(123)".  I have 17,915 observations. 
If I limit my dataset to a smaller number of observations (using drop
or keep) to, say 1,000, or hardwire a smaller number, the program
sucessfully writes out the data.

After searching the documentation I cannot find a limit to the number
stored in numlist.  Is there such a limit?  If so, can it be


*** Stata Code Follows ***
  quietly count;
  local l = r(N);
  foreach i of numlist 1/`l'{;
    file write temp
     _col(1)  %5.0f  (frm_id1[`i'])
     _col(8)  %5.0f  (co_id1[`i'])
     _col(14) %9.1f  (est_rnd_amt_fund[`i'])

*   For searches and help try:

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