Date: Tue, 12 Jan 2010 11:41:59 -0800
Reply-To: hd <heenagd@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: hd <heenagd@GMAIL.COM>
Organization: http://groups.google.com
Subject: data manipulation
Content-Type: text/plain; charset=ISO-8859-1
HI,
I am a bit stuck on this problem.
I have a dataset of dates sorted
1.01/02/2006
2.01/03/2006
3.01/04/2006
4.01/07/2006
5.01/08/2006
6.02/01/2006
7.02/02/2006
8.02/08/2006
9.02/09/2006
I would like to create a dataset
where I have the dates above and the corresponding previous date. Also
I wwould like to create a number column for each month corresponding
to the date column that resets at a new month
So something like
date prevdate number
01/02/2006 1
01/03/2006 01/02/2006 2
01/04/2006 01/03/2006 3
01/07/2006 01/04/2006 4
01/08/2006 01/07/2006 5
02/01/2006 01/08/2006 1
02/02/2006 02/01/2006 2
02/08/2006 02/02/2006 3
02/09/2006 02/08/2006 4
Many many thanks for your help