|Date: ||Tue, 7 Dec 2004 14:59:48 -0500|
|Reply-To: ||Ya Huang <ya.huang@AMYLIN.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Ya Huang <ya.huang@AMYLIN.COM>|
|Subject: ||Re: Simple data querying problem|
A less efficient but maybe easy to understand data step solution:
data expb (drop=time rename=(expandt=time));
do expandt=time-1 to time+1 by 0.05;
merge a (in=a) expb (in=b);
if a and b;
The idea is to expand each record of B to cover the time span
of -1 to +1 hour of it, assume the time accuracy is 0.05 hour.
then merge the expanded B with A and test where the record
On Tue, 7 Dec 2004 13:43:34 -0500, Zach Peery <zpeery@NATURE.BERKELEY.EDU>
>Sorry about the last post - it seemed to want to send itself. in the
>meanwhile - I thought of a better way to explain the problem...
>I am trying to identify observations in dataset A that occured within 1
>hour of any observation in dataset B, and place these observations in a
>new dataset. Note that time is in hh.hh format such that 13.50 = 1:30 pm.
>Thanks, I really appreciate any help that the list can provide. Zach