Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: imputing dates into a string date

From   daniel klein <>
Subject   Re: st: imputing dates into a string date
Date   Thu, 7 Jun 2012 16:25:47 +0200


this is (probably) much simpler than you might assume. All you need to
type is the one line

g dx_clean = subinstr(dx, "XX", "01", .)

Substitute -g dx_clean- in the code with -replace dx- if you want to
change your original variable.


Hi all,
This is working fine, until I come across a date that actually starts like this:


Then my code to generate a date returns a blank. What I would like to
do is add in something that allows me to evaluate whether the day is
xx and if so, insert 01.
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index