LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (August 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 7 Aug 2009 08:32:18 -0700
Reply-To:   ash007 <RamsamyAshley@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   ash007 <RamsamyAshley@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: hash problematic
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=UTF-8

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 !


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