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

st: Replace string


From   Robin Newberry <[email protected]>
To   [email protected]
Subject   st: Replace string
Date   Wed, 2 Mar 2005 13:45:33 -0500

As an easy way to group accidents by year, the data has a field with simply the year of the accident. Unfortunately, they've chosen to enter 2 date years, rather than 4 date years. This presents 2 problems:

1) 9999 is sometimes entered as shorthand for "date unknown"
2) There are other weird things in there too, (like I93 for an accident in 1993)

What I'd like to do is clean this up to 4 digit years; I realize some things will just have to be hand edited, but is there a way to batch replace -00- with -2000-?
--
Robin
--------------------------------------------------------------
W. Robert Newberry, IV CIH, CHMM
Chief Environmental Health and Safety Officer
Clemson University

[email protected] [email protected]
http://ehs.clemson.edu/
*
* 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