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]
Re: st: -confirm variable- does not accept varlist (wildcards)
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: -confirm variable- does not accept varlist (wildcards)
Date
Thu, 5 Sep 2013 15:30:52 +0100
. sysuse auto, clear
(1978 Automobile Data)
. confirm var m*
m ambiguous abbreviation
r(111);
. unab m : m*
. confirm var `m'
Nick
[email protected]
On 5 September 2013 15:18, László Sándor <[email protected]> wrote:
> Just a note about something that bit me hard in the last few days:
> contrary to the help file, -confirm variable- did not take a string I
> meant as a varlist in the form of "q_*" but produced an error that *
> is invalid. As the typical use case is with -capture- and -if (_rc)-,
> I did not notice that the wrong fork of my code was executed until
> quite some time.
>
> To be clear, I am not sure how confirm *should* work with wildcards or
> multiple variables anyway, I know. And it does accept abbreviations.
> So "q_" does work, and it is even clearer about my intentions. And I
> should have tested the code anyway. And I probably should have used
> more specific -if (_rc==)- specifications to distinguish the variable
> genuinely missing from other errors.
>
> That said, it does not feel right to be bitten by a casual "varlist"
> specified in the documentation actually not complying with what
> varlists are. A few weeks ago I had a similar issue with ranges of
> variables in the keepusing() option of -merge-.
>
> Thanks,
>
> Laszlo
> *
> * 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/
*
* 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/