Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: a little string question.


From   [email protected]
To   [email protected]
Subject   st: a little string question.
Date   Wed, 8 Oct 2003 13:16:42 -0400

Dear stata users,

I have a string variable (caseid) coded on the format :


. codebook caseid


caseid ---------------------------------------------------- Case Identification
                  type:  string (str16), but longest is str15

         unique values:  3109                 coded missing:  0 / 3552

              examples:  "7 2 177 43  2"
                         "1210  51140  2"
                         "1831 105 76  5"
                         "2647   3 40  2"


I want:  72177432
            1210511402
etc.,

I use the command: g newid=trim(caseid)
but it returns a type mismatch error.

The real() and destring commands don't work and the encode one leaves blanks as
caseid.

Can somebody helps?

Cheers.

Amadou.


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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