|
On Aug 6, 8:22Â pm, HERMA...@WESTAT.COM (Sigurd Hermansen) wrote:
> Even though you have the authoritative answer from the SAS Hashman himself, this article provides additional detail:http://www.nesug.org/proceedings/nesug06/dm/da07.pdf
>
> Much earlier threads on the 'L led to a general realization that SAS hash objects can substitute for SAS SQL queries and perform much more efficiently than what the SAS SQL "query optimizer" supposes. I join Paul in wondering why that is.
> S
>
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of Paul Dorfman
> Sent: Thursday, August 06, 2009 1:12 PM
> To: SA...@LISTSERV.UGA.EDU
> Subject: Re: hash problematic
>
> Ash007,
>
> Well, now *this* is easy to remedy:
>
> data jointure_bidon_h (keep = x1 w2) ;
> Â Â if _n_ = 1 then do ;
> Â Â Â if 0 then set table_bidon1 table_bidon2 ;
>    dcl hash h  (dataset: "table_bidon2") ;
>    h.definekey  ("w1") ;
> Â Â Â h.definedata ("w2") ;
> Â Â Â h.definedone () ;
> Â Â end ;
>
> Â Â set table_bidon1 ;
>
> Â Â if h.find (key: x1) ne 0 then call missing (w2) ;
> run ;
>
> Kind regards
> ------------
> Paul Dorfman
> Jax, FL
> ------------
>
> On Thu, 6 Aug 2009 02:57:04 -0700, ash007 <RamsamyAsh...@GMAIL.COM> wrote:
>
> >thanks for your advice.
>
> >i want to transform the left join to hash code please. thanks. ash007.
>
> >data table_bidon1;
> > Â Â Â Â input x1 x2 x3 x4 x5 $; cards;
> >     1 5 5 1161 ab鬩en
> >     2 5 5 1161 ab鬩en
> >     3 6 3 1336 alm鲩c
> > Â Â Â Â 4 1 5 1499 aniel
> > Â Â Â Â ;
> >run;
>
> >data table_bidon2;
> > Â Â Â Â input w1 w2 w3 w4 w5 $; cards;
> >     3 6 3 1336 alm鲩c
> > Â Â Â Â 4 1 5 1499 aniel
> >     5 6 3 1336 alm鲩c
> > Â Â Â Â 6 1 5 1499 aniel
> > Â Â Â Â ;
> >run;
>
> >proc sql;
> > Â Â Â Â create table jointure_bidon as
> > Â Â Â Â select a.x1,b.w2
> > Â Â Â Â from table_bidon1 as a
> > Â Â Â Â left join table_bidon2 as b
> > Â Â Â Â on a.x1 = b.w1
> > Â Â Â Â ;
> >quit;
thanks !
|