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]

st: appending date variable in 2 datafiles

From   Kamarul Imran <>
Subject   st: appending date variable in 2 datafiles
Date   Wed, 17 Oct 2012 11:58:46 +0100

Hi all,

I have a date variable in a stata datafile :


1.	14dec2010
2.	19dec2010
3.	30mar2010
4.	16jun2010
5.	06jan2010

and I have a date variable also in a stata datafile that I would like
to append to the datafile above (DATAFILE A)


doa                  date3
1.  23-05-2012           .
2.  03-11-2011   11mar2011
3.  02-09-2010   09feb2010
4.  01-07-2010   07jan2010
5.  18-04-2012           .

The problem is both datafiles use different format of date, the former
uses numeric and the latter uses str. My questions would be
1) what is the best way to work around appending this two datafiles
2) i have converted the 'doa' in the latter file (DATAFILE B) using

generate date3=date(doa,"MDY")
format date3 %d

but only obs from 2 to 4 were converted but obs 1 and 5 were not.

Really appreciate if someone can help me with these 2 questions.

Lancaster Uni
*   For searches and help try:

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