Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: too many macros
From
Keith Dear <[email protected]>
To
[email protected]
Subject
Re: st: too many macros
Date
Thu, 30 Jun 2011 12:52:03 +1000
Ali,
Is your program really called "prog"? That's not wise - you can define
it, but how do you call it?
Try a name that is not a reserved word (e.g. "myprog").
That aside, I can't elicit that error message: your code works for me,
even with 1000 rhs variables.
Which version do you have? In Stata11, -help limits- does not mention
any such limit, even for Small Stata.
Keith
On 30 June 2011 12:01, ali hashemi <[email protected]> wrote:
> Dear list members,
>
> Is there any limit on the number of macros that can be defined in a program?
> I am using local macros to read the regressors in the varlist. Here is the
> syntax:
>
> program prog
> syntax varlist
> local N: word count `varlist'
> gettoken lhs rhs: varlist
> forval i=1/`N' {
> local x`i' : word `i' of `rhs'
> }
> ...
> end
>
>
> The above code works fine when the number of variables in the varlist is
> less than 18. However, in my case I have at least 400 variables in the
> varlist and I get this error message: "too many macros"
>
> Is there anything wrong with the above code that causes this problem? If
> there is a limit for the number of macros defined in the program how can I
> call the regressors in the varlist?
>
>
> Your help is very much appreciated
> Best,
> Ali
>
>
>
>
> *
> * 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/
>
--
Dr Keith Dear
National Centre for Epidemiology and Population Health
ANU College of Medicine, Biology and Environment
Australian National University
Canberra, ACT 0200 Australia
Phone +61 (02) 6273 2208
*
* 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/