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
Content-Type: text/plain; charset=us-ascii
On Fri, 05 Sep 2008 18:03:34 GMT, Jay Weedon <firstname.lastname@example.org>
>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.