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

RE: st: comparing two .dta files

From   "Nick Cox" <>
To   <>
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-----
[] On Behalf Of Gabi Huiber
Sent: 12 February 2008 22:02
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.


On Feb 12, 2008 4:46 PM, Nick Cox <> 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
> Nick Winter
> Without considering the larger logic of what you are doing, this line
> 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
> limit on the length of a string expression; see help limits).

*   For searches and help try:

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