Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: How can I check that a variable exists?


From   "Benjamin Villena Roldan" <bvillena@troi.cc.rochester.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: How can I check that a variable exists?
Date   Thu, 12 Mar 2009 18:29:04 -0400

Thank you. You are very kind and helpful.

-----Mensaje original-----
De: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] En nombre de Sergiy Radyakin
Enviado el: Thursday, March 12, 2009 6:20 PM
Para: statalist@hsphsun2.harvard.edu
Asunto: Re: st: How can I check that a variable exists?

Hi,

capture confirm variable XA
if !_rc {
....... Action A ......
}

capture confirm variable XB
if !_rc {
  ..... Action B.......
}

also see help capture

Regards, Sergiy Radyakin

On Thu, Mar 12, 2009 at 6:16 PM, Benjamin Villena Roldan
<bvillena@troi.cc.rochester.edu> wrote:
> Dear statalist,
> This may sound like a trivial question, but I unsuccessfully looked for an
> answer so far.
>  I need to perform certain action A if there is a variable XA defined in
> the dta file, and an action B if there is a variable XB in the dta file.
How
> can I do so? Any ideas?
>
> Thanks
>
> Benjamin
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/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/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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