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 (September 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 5 Sep 2008 18:18:42 GMT
Reply-To:     Jay Weedon <jweedon@EARTHLINK.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jay Weedon <jweedon@EARTHLINK.NET>
Subject:      Re: Table lookup puzzle
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=us-ascii

On Fri, 05 Sep 2008 18:03:34 GMT, Jay Weedon <jweedon@earthlink.net> wrote:

>Hi folks, > >Guess I must be losing my grip of SAS programming, because I can't >come up with an efficient solution to this easy-sounding problem. > >The master dataset A contains two date fields (the dates vary across >records). The dataset to be consulted B contains one date field and >one result field. The goal is for A to acquire 2 new fields: one >representing the sum of all the results in B that occur within the >window specified by the dates in A; the other is the number of >observations in B from which that mean is computed.

I meant "sum" rather than "mean" at the end there. Mean won't make sense if no observations are found that lie in the window.

Oh, and I forgot to mention that it needs to be a fairly efficient solution because there are millions of records in both sets.

JW


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