Date: Tue, 12 May 2009 14:35:15 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Carry Croghan <Croghan.Carry@EPAMAIL.EPA.GOV>
Subject: Re: Date Comparison
Content-type: text/plain; charset=US-ASCII
just an aside, one of the nice things about the structure of the
yyyymmdd format of dates is that you can do a comparison between the
values without having to translate into SAS date values.
But to do the within two weeks that does require translation.
Date8. format is different it is ddMONyy.
Your dates are formatted as yymmddn8.
Others have been very helpful on how to input the data and do the
comparison so I won't waste time with that.
Carry W. Croghan
From: Michael Bryce Herrington <mherrin@G.CLEMSON.EDU>
Date: 05/12/2009 12:28 PM
Subject: Date Comparison
I would like to compare dates of certain variables. My dates were input
numbers however. So first questions is to reformat the as dates will
something like this work? They are in the date8. form I think, ie.
The next thing I want to do is make a binary variable, recentrace, that
be 1 if the last race was within 2 weeks, 0 otherwise.
Sample data (I will leave it as numbers like how it is for me now).
input date lastdaterace;
111 Briar Lane
Central, SC 29630