Date: Tue, 26 Nov 2002 12:46:24 -0500
Reply-To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject: Re: extract records
Content-Type: text/plain; charset="iso-8859-1"
Try Proc SQL where the BETWEEN operator originates in SAS:
Create table work.subset as select * from <dataset>
where date2 between (date1 - 4) and (date1 +7);
From: Max F [mailto:max8ca@YAHOO.COM]
Sent: Tuesday, November 26, 2002 12:30 PM
Subject: extract records
I need to extract records from two data sets. Data set
One has a single date record for a given ID and Data
set Two has multiple date records for a given ID. I
need to pull out record from Data set Two whose date
is within minus 4 days and plus 7 days of a date in
Data set One.
I tried using
where date2 between (date1 - 4) and (date1 +7)
in a data step but it did not do it. It returned dates
in Data set One that are more than 4 days before
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.