Date: Fri, 22 Apr 2011 13:57:11 -0400
Reply-To: Gabriel Rosas <rosas.gabe@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gabriel Rosas <rosas.gabe@GMAIL.COM>
Subject: Re: Identifying dates within 3-month range
Content-Type: text/plain; charset=ISO-8859-1
Or following Sterling's suggestion:
If intnx('day',surgery_date,-90) LE surgery_date LE If
On Apr 22, 2011 1:52 PM, "Suzanne McCoy" <
> If intnx('month',surgery_date,-3)
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jill
> Sent: Friday, April 22, 2011 1:39 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Identifying dates within 3-month range
> Hello everyone. I'm working with a macro to match controls to cases based
on a surgery date range of +/-3 months. Surgery date is in the mmddyy8.
form. I've been scouring the Internet looking for guidance on how best to do
this, but I'm not having much luck.
> Here's my thinking thus far: If I extract the months from each date, I'll
only get a crude +/- 3 month estimate that doesn't take into account the
days of the month. If I convert the entire date to days and use a +/- 30 day
range, I can't accurately account for months with 31 days.
> So my question is, am I even able to use the entire date (mmddyy8.) in
getting the most precise +/- 3 month range? If so, what's the best syntax
format to accomplish this task?
> Thanks in advance.