Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Too many macros, but I create 1!

From   James Sams <>
Subject   st: Too many macros, but I create 1!
Date   Wed, 05 Dec 2012 18:28:20 -0600

I have a program that drops into mata, generates a row vector, converts it to 
strings and then sends to stata as a macro. The macro it generates is about 
400,000 characters long, with about 62,000 individual entries, well within the 
limits of stata-12 mp 8 core edition. Here is some test code that shows what 
is going on and mimics the attributes of my data.

program test_case, rclass
    mata {
        indexes = 50000
        for (i=1; i<=61611; i++) {
            indexes = indexes, i+indexes[1]
        indexes = strofreal(indexes)
        indexes = invtokens(indexes)
        st_local("indexes", indexes)
    return local indexes `indexes'

And when I run it:

. test_case
too many macros

I'm certainly not generating too many macros. Either st_local or return is, as 
far as I can tell. Thoughts on what I should be doing?

James Sams
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index