Dear Statalist members,
How can I replace characters at specific locations within an
eight-character string?
I'm using -todate- with mostly good success to convert an
eight-character string to Stata date, except when a month or day
within that string is unknown. That would be coded "99", as in:
"01991994", for "some day in January, 1994"
I'd like to edit that string to "01011994". Can this be done?
Tangentially, my code is:
todate datevar, gen(newdatevar) p(mmddyyyy) f(%dd_m_cy)
format datechemo %d
Thank you,
Michael
--
Michael McCulloch
Pine Street Foundation
124 Pine St., San Anselmo, CA 94960-2674
Tel: (415) 407-1357
Fax: (415) 485-1065
[email protected]
*
* 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/