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

Re: st: converting a string into a date


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: converting a string into a date
Date   Mon, 30 Aug 2004 08:32:15 -0500

Fabrizio Stracci

I have a large file containing a date of birth variable coded "ddmmyyyy"
without any separator. User's manual on page 306 suggests a solution for a
similar case. However there should be some way to insert characters at a
fixed position into a string (i.e. a "/" after the second and the fourth
character) or to generate three new substrings containing day, month, and
year respectively again based on the fixed position of day, month, and year
in the string... probably I just overlooked it. Many thanks for your help.
There is a FAQ on this question at
http://www.stata.com/support/faqs/data/dateseq.html

Among other solutions, a dedicated program -todate- is available
at SSC.

. ssc inst todate
. whelp todate

Nick

[email protected]
(visiting StataCorp)
*
* 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