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

From |
Kyle Hood <kyle.hood@yale.edu> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

Subject |
Re: st: How can I check that a variable exists? |

Date |
Thu, 12 Mar 2009 15:24:37 -0700 |

The command . qui cap d xa Sets _rc to 0 if xa exists, and 111 if not. Thus, . qui cap d xa . if _rc == 0 { . a // this is my action . } Kyle Hood Department of Economics Yale University

Dear statalist,This may sound like a trivial question, but I unsuccessfully lookedfor ananswer so far.I need to perform certain action A if there is a variable XAdefined inthe dta file, and an action B if there is a variable XB in the dtafile. Howcan 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/

**References**:**st: Does -insheet- read data incorrectly?***From:*Dirk Enzmann <dirk.enzmann@uni-hamburg.de>

**st: How can I check that a variable exists?***From:*"Benjamin Villena Roldan" <bvillena@troi.cc.rochester.edu>

- Prev by Date:
**st: How can I check that a variable exists?** - Next by Date:
**Re: st: How can I check that a variable exists?** - Previous by thread:
**st: How can I check that a variable exists?** - Next by thread:
**Re: st: How can I check that a variable exists?** - Index(es):

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