Date: Fri, 10 Sep 2004 15:15:44 -0400
Reply-To: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject: Re: Compare Similarity
Read up on the SCAN function. You can get 1st, 2nd, ... or nth word.
On Fri, 10 Sep 2004 12:13:55 -0400, Thomas <tythong@YAHOO.COM> wrote:
>Hi all,
>
>I encountered a problem of comparing/matching the two dataset with highly
>similar two items. Using the "scan" in proc sql, it only compares the
>first word before the next blank between the two items. However, how to
>make it more generic so that we can compare the words upto 2 before the
>next blank.
>
>Thank you very much!
>Thomas
>
>
>proc sql;
> create table staff_fin as
> select * from staff_cost2 natural join financial
> where scan(CoName2,1,' ')=scan(CoName,1,' ') and fyr=fyr2;
>quit;
>
>
>The scan part only compare the first non-blank words between CoName2 AND
>CoName. Is it possible to compare upto 2 or even more accurate words
>between CoName and CoName2? The CoName or CoName2 may have one or more
>words.
|