Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | László Sándor <sandorl@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: -confirm variable- does not accept varlist (wildcards) |
Date | Thu, 5 Sep 2013 10:59:31 -0400 |
Yes, this is what I should have done. That said, I don't see why confirm itself cannot unabbreviate if it does take multiple variables. Wildcards are not an ambiguous abbreviation… On Thu, Sep 5, 2013 at 10:30 AM, Nick Cox <njcoxstata@gmail.com> wrote: > . sysuse auto, clear > (1978 Automobile Data) > > . confirm var m* > m ambiguous abbreviation > r(111); > > . unab m : m* > > . confirm var `m' > Nick > njcoxstata@gmail.com > > > On 5 September 2013 15:18, László Sándor <sandorl@gmail.com> 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/ * * 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/