Statalist


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

Re: st: ds, has(type string) in version 8


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: ds, has(type string) in version 8
Date   Tue, 7 Oct 2008 13:22:49 -0400

Hello Kim,

you can follow this logic:
1) check the variable exists with: confirm variable varname
2) checj the variable is numeric: confirm numeric variable varname
3) if #1 is true and #2 fails - varname is a string variable. use
-capture- to capture the result and process it in your program

This logic should work in Stata 8 without any problem and perhaps much
earlier. How earlier? How can one determine if the command will work
in the earlier version of Stata if the command is built-in (both
-confirm- and -capture- are built-in)

Regards, Sergiy Radyakin


On Tue, Oct 7, 2008 at 11:45 AM, Kim Oren Gradel / Region Nordjylland
<[email protected]> wrote:
> Dear Stata people,
>
> I have a (hopefully) fairly simple question. I use Stata 9.2 in which there is no problem with the command
> - ds, has(type string) -
> Stata 8, which is used by a colleague, does not seem to recognize the -has- command:
>
> . ds, has(type string)
> option has() not allowed
> r(198);
>
> Is -has- novel in Stata9?
>
> Best regards,
>
>
> Kim O. Gradel
> DVM, PhD, research assistant
> Forskningens Hus
> Department of Clinical Epidemiology
> Sdr. Skovvej 15
> Aalborg Hospital, Århus University Hospital
> DK-9000 Aalborg, Denmark
> Phone, direct: +45 99 32 69 02
> Fax: +45 99 32 69 14
> E-mail: [email protected]
>
> *
> *   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index