Date: Thu, 8 Aug 2002 08:57:07 -0400
Reply-To: "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Subject: Re: Match Merging on Index function
Content-Type: text/plain; charset="iso-8859-1"
Thanks to Peter & Paul (where's Mary?).
Peter's solution did work as advertised. Paul's did also, in about half the
time.
Thanks again,
Brad
> -----Original Message-----
> data _null_ ;
> call symput ('n', put(n, best.-l)) ;
> stop ;
> set decoder nobs = n ;
> run ;
>
> Data Count ( keep = name count ) ;
> array as (1 : &n) $ 500 _temporary_ ;
> array an (1 : &n) $ 17 _temporary_ ;
> array ct (1 : &n) _temporary_ ;
> do n = 1 to &n ;
> set decoder ;
> as(n) = string ;
> an(n) = name ;
> end ;
> do until ( eofA ) ;
> set A end = eofA ;
> do n = 1 to &n ;
> if index (request, trim(as(n))) then ct(n) ++ count ;
> end ;
> end ;
> do n = 1 to &n ;
> count = ct(n) ;
> name = an(n) ;
> output ;
> end ;
> run ;
|