Statalist


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

st: RE: Semi-bug


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Semi-bug
Date   Thu, 6 Mar 2008 15:30:33 -0000

-duplicates- is an official Stata command. 

In essence, in this circumstance Stata gives the wrong reason for the
right decision. 

What is happening is that as differing syntaxes are allowed, each legal
syntax is tried
in turn. 

What you type is being passed as a whole to -syntax-: that is as is it
should be. 

Your syntax fails each possibility and in particular does not satisfy
the last possibility, 
so you get the corresponding error message. My guess is that what would,
in hindsight, 
have been a more appropriate error message was in fact eaten earlier on
by -capture-. 

I think it is really difficult to trap all user errors with exactly
correct messages. 

For example, if I put . on command lines by mistake, Stata often guesses
that I want to
specify a time series operator. Usually I just typed . when I meant ,
but Stata gets
that wrong. But as I typed something illegal, it's not surprising that
Stata can't puzzle it out
correctly, especially as it is only working on syntax, not semantics. 

Nick 
[email protected] 

Fred Wolfe

I have come across a wrong error message.

The variable -novar- does not exist.

. duplicates drop patkey date if novar !=.,force
varlist not allowed
r(101);

. duplicates drop patkey date if date != .,force

Duplicates in terms of patkey date

(38 observations deleted)

I suspect that -novar- is passed as a macro and generates this message
because it is missing.

It took a while to figure all of this out. So fixing the message might
be of help to others.


*
*   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