LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 7 Dec 2004 15:41:35 -0500
Reply-To:     "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Subject:      Re: Simple data querying problem
Comments: To: Zach Peery <zpeery@NATURE.BERKELEY.EDU>
Content-Type: text/plain; charset="iso-8859-1"

Does this mean that you do not have an issue with crossing day boundaries? If that is the case a key indexed approach should work well too.

data A ; input time time. ; cards ; 9.00 13.00 14.00 21.00 run ;

data b ; input time time. ; cards ; 9.25 13.50 23.00 run ;

data c ; array t (86400) _temporary_ ; do until (eof1) ; set b end = eof1; t(time) = 1 ; end ; do until (eof2) ; set a end = eof2 ; done = 0 ; do i = time to (time-3600) by -1 until (done) ; if t(i) then done = 1 ; end ; if not done then do i = time+1 to time+3600 until (done) ; if t(i) then done = 1 ; end ; if done then output ; end ; format time time. ; run ;

Venky Chakravarthy

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Zach Peery Sent: Tuesday, December 07, 2004 1:44 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Simple data querying problem

Hi All,

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.

DATASET A time 9.00 13.00 14.00 21.00

DATASET B time 9.25 13.50 23.00

DESIRED DATASET time1 9.00 13.00 14.00

Thanks, I really appreciate any help that the list can provide. Zach

LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.

Back to: Top of message | Previous page | Main SAS-L page