I should add an example. Unfortunately I don't have access to Stata
right now, so forgive me for any issues with the example.
clear
set obs 5
gen i = _n
gen abcdefghijklmopqrstuvwxyz_1 = 0
gen abcdefghijklmopqrstuvwxyz_2 = 0
reshape_10 long abcdefghijklmopqrstuvwxyz_, i(i) j(j)
clear
set obs 5
gen i = _n
gen abcdefghijklmopqrstuvwxyz_1 = 0
gen abcdefghijklmopqrstuvwxyz_2 = 0
reshape long abcdefghijklmopqrstuvwxyz_, i(i) j(j)
If somebody can confirm that this example shows what I intend (the
first block passes, the second fails), that would be appreciated.
James
On Mon, Aug 25, 2008 at 11:05 AM, James Muller <[email protected]> wrote:
> Hi list,
>
> A new major version of reshape was released, but it imposes a restriction on
> the maximum length of variables it can reshape (at least from wide->long).
> Specifically, reshape fails on variables with names longer than 20 characters.
>
> I realized this when it caused a large (a couple of thousand do-files
> involved) system to fail...
>
> There's a quick solution, but it sucks. The old reshape command is still
> available as the command reshape_10. The solution is to replace all reshape
> command calls with reshape_10. It is a shame 'reshape' is also a word in natural
> language.
>
> Under the hood, reshape obtains details of the variables via the 'char'
> system (?), which creates variables describing variables from your dataset,
> prefixing them... That is, the dataset variable name plus the prefix can
> violate Stata's 32-character variable name limit.
>
> I ask, is there the possibility of thes very important Stata command, reshape,
> being modified so that it can accept variable named according to the general
> convention in Stata?
>
> As I say, there is the option of using reshape_10, but, well, that's a lazy
> solution.
>
> Cheers
>
> James
> *
> * 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/
>
*
* 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/