You need to specify the format:
gen dob2 = string(dob1, "%10.0g")
or you could use -tostring-
tostring dob1, gen(dob2)
Hope this helps,
Scott
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of M. Nizam Khan
Sent: Tuesday, June 29, 2004 1:20 PM
To: [email protected]
Subject: st: data conversion
Hi Statalister,
I want to convert dob1,which is a numeric variable, into a string variable.
So I created dob2=string(dob1). But, for example, I want to see "dob2"
as "19410700" not "1.94e+07". How can I do it?
dob1 dob2
19410700 1.94e+07
Thanks.
*
* 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/