Date: Sun, 9 May 2010 09:40:32 -0400
Reply-To: Kevin Viel <citam.sasl@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kevin Viel <citam.sasl@GMAIL.COM>
Subject: Re: Distinguishing between duplicates and missing lookups with
set-key
On Mon, 3 May 2010 06:50:22 -0400, Muthia Kachirayan
<muthia.kachirayan@GMAIL.COM> wrote:
>data need;
>if _n_ = 1 then do;
> if 0 then set lookup(keep = x a);
> declare hash h();
> h.definekey('x','a');
> h.definedata('RID');
> h.definedone();
> do RID = 1 by 1 until(done);
> set lookup(keep = x a) end = done;
> h.add();
> end;
> done = 0;
>end;
>
>do until(done);
> set master end = done;
> if h.find() = 0 then do;
> set lookup(keep = y) point = RID;
> output;
> end;
>end;
>stop;
>run;
Of course, one might encounter the situation in which MASTER is smaller
than LOOKUP.
>Your feed-back to SAS-L is appreciated.
This is always a polite policy of the OP, not only for the posters who,
like myself, are still learning, but also for the archives so one can
potentially find a solution to one's similar problem. If the problem
gets "solved" but not posted, then one might have to submit the question
again.
Including:
1) OS and SAS version
2) The relevant portion of the log
3) Example data
4) After the exchange, the status of the problem and what solution one
chose, if any
HTH,
Kevin
|