Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: comparing two .dta files


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: comparing two .dta files
Date   Tue, 12 Feb 2008 22:11:22 -0000

No, you weren't being silly. 

Stata's macro processing really is a little quirky. There are surprises
like this one, and often only getting burned makes a point vivid. In
most programming languages, it is usual to be able to assume that
whatever is to the right of an equals sign will all get noticed, so
finding out that need not be true is inevitably a shock. 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Gabi Huiber
Sent: 12 February 2008 22:02
To: [email protected]
Subject: Re: st: comparing two .dta files

Agree, and I feel duly chastened. This is yet another example of how,
when it seems like Stata does the same thing in more than one way,
you're probably overlooking something. I always thought that when
declaring locals the = and the lack of it were interchangeable. That
was silly.

Gabi

On Feb 12, 2008 4:46 PM, Nick Cox <[email protected]> wrote:
> As Gabi later replied, this was the nub of the problem.
>
> Note that this gotcha is prominently documented.
>
> In the Stata 10 manuals, it is documented at [U] 18.3.4.
>
> Every once in a while, every serious Stata user really should just sit
> down and read [U]. Naturally, you can skim and skip the bits you know
> already, and the bits you think you know you don't need right now, but
> you'll discover, or rediscover, many crucial details, like this one.
>
> Nick
> [email protected]
>
> Nick Winter
>
> Without considering the larger logic of what you are doing, this line
is
>
> probably the/a problem:
>
>    local mergeby`k'="`mergeby`k'' `var'`k'"
>
> When you use the equal sign, you are telling Stata to evaluate the
> string that follows; that gets truncated to 244 characters (which is
the
>
> limit on the length of a string expression; see help limits).

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index