Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: AW: tostring command


From   Rajaram Subramanian Potty <rajara999@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: tostring command
Date   Fri, 23 Apr 2010 15:41:58 +0530

Thank you very much for the quick reply and is very much helpful in
converting the numeric variable to string variable.

Thanks and regards,

RAJARAM. S

On Fri, Apr 23, 2010 at 3:20 PM, Martin Weiss <martin.weiss1@gmx.de> wrote:
>
> <>
>
> Either -force- it or supply your own -format-, with the latter option
> strongly perferred:
>
>
> *************
> clear*
> set obs 1
> gen double myvar=12345612345
> format myvar %11.0f
> l
> tostring myvar, generate(mystrvar) force
> tostring myvar, generate(mystrvar2) format(%11.0f)
> l
> *************
>
>
>
> HTH
> Martin
>
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Rajaram
> Subramanian Potty
> Gesendet: Freitag, 23. April 2010 11:31
> An: statalist@hsphsun2.harvard.edu
> Betreff: st: tostring command
>
> Dear all,
>
> When I am using the command "tostring" to convert numerical variable
> to string variable I am getting an error.
>
> The error is "indid cannot be converted reversibly; no generate".
>
>  This error comes only if the numerical varibale has 11 or more
> digits. Because of this not able to convert numerical variables with
> 11 or more digits to string variable. Can any one know the solution to
> convert the numerical variable to string variable even if the variable
> has 11 or more digits.
>
> Thanks and regards,
>
> RAJARAM. S
> *
> *   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   |   Site index