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: References for `= foo'
From
Sergiy Radyakin <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: References for `= foo'
Date
Tue, 30 Jul 2013 18:18:28 -0400
Dear Wayne,
number of characters in a macro used to be 1mln in Stata 12 and
earlier versions too. http://www.stata.com/help10.cgi?limits
The relevant limitation was the length of a result of a string
expression. So in the limits table, the correct line to look at is:
In Stata 12:
length of string in string expression 244 244 244
In Stata 13:
length of string
in string expression 2,000,000,000 2,000,000,000 2,000,000,000
This change is described in item 64b here:
http://www.stata.com/help.cgi?whatsnew12to13 :
b. the maximum length of a string in string expressions increases
from 244 to 2-billion characters. See limits.
The example of the code that behaves differently (as expected) after
this change is here:
http://radyakin.org/statalist/2013073002/test5.do
I put a "version 12" statement at the top and suspect the old
truncation behavior will not be activated by it in Stata 13 (which is
good). Can somebody having Stata 13.0 confirm this please?
Another interesting thing is that although the official limit was
declared as 244 in Stata 12.0, the actual length of the string
(truncated) is 245 characters (and is same in e.g. Stata 9).
Finally, the most interesting (at least for me) point is that while
solving one problem, another one is now created. Before 13 we could be
sure that any value of a string variable could be fit into a macro,
but not every macro (potentially 1 mln chars) could be saved into a
value of a string variable (up to 244 chars). Now in 13 we have the
reverse problem: any macro (1mln) can be saved into a string variable
(2bln), but not any value of a string variable (2bln) can be put into
a macro (1mln).
Best, Sergiy Radyakin
On Tue, Jul 30, 2013 at 4:55 PM, Wayne Folta <[email protected]> wrote:
>> If there is a function or a reference to a variable in the dataset
>> that you want to get evaluated, you place '=' in front. Be careful
>> with strings as string expressions are subject to a rather low chars
>> limit (not sure about Stata 13).
>
> It appears that it's longer than in the past. In Stat/IC 13 I just created a local macro using = and not using = that was 1700 characters long in both cases. If I did this correctly, this is a huge improvement!
>
> Not sure which limit is applicable, but my Stata 13 shows:
>
> small IC SE/MP
> # of characters in a macro (2) 13,400 165,200 1,081,511
> length of a str# variable 2,045 2,045 2,045
>
> Wayne
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/