Bookmark and Share

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]

st: Variable name length limit


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Variable name length limit
Date   Wed, 19 Jun 2013 13:28:11 +0100

I'll comment generally on a simple level.  This is a question that
sometimes prompts surprised questions and confused comments.

As usual, this is one perception and written in ignorance of
StataCorp's intentions for Stata 14 or beyond.

1. Stata has limits, which it documents. -help limits- is doubly
useful in bringing them together in one place and documenting what
applies to the Stata you are using.

2. The limit on length of variable names is in recent versions of
Stata  32 characters and not adjustable.

3. The issue behind most limits is memory, but my strong impression is
that the issue with variable names is just space to show results.
Imagine even a modest increase in variable name length to 64
characters. Now imagine what the output would look like for any of
your favourite commands, assuming a disinclination to abbreviations
(you would not have chosen those long names if you didn't mean them).

4. Those who go up to the limit of 32 characters, or close to it,
should not be surprised by any command that falls over when it tries
to add extra characters to your variable names.

5. You may need to shorten long variable names, or for some purposes
use clones of variables with long names.

clonevar copy1 = verylongnameindeedthatneedstobeshorter

6. -findname- (SJ) offers one systematic way to find long variable names.

findname, any(length("@") > 20)

Nick
[email protected]
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index