LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 8 Jul 2005 02:20:24 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: fuzzy string search
Comments: To: davidlcassell@MSN.COM
In-Reply-To:  <BAY103-F18B94614E04D1134C93279B0DB0@phx.gbl>
Content-Type: text/plain; format=flowed

Well David my pearl headed friend I am not that big of a fan of Perl. Wonder if it is like when I wasn't a big fan of SQL till I reallt sat down and started to try to understand it and use it every day. Hmmm.. It is around that five year mark since I start learning SAS perhaps it is time to learn another language.

Perl, Java, C, C+, Cobol, Fortran (the lastest version), hmmm so many choices....

Toby Dunn

From: DavidL Cassell <davidlcassell@MSN.COM> Reply-To: DavidL Cassell <davidlcassell@MSN.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: fuzzy string search Date: Thu, 7 Jul 2005 17:06:42 -0700 Jennifer_Lin@CHIRON.COM replied: >I think you may want to look into using regular expressions. There are SAS >RX functions available in SAS V8.1: RXPARSE, RXMATCH, etc... > >Apparently there are now also new Perl regular expression functions >available in SAS V9. Look up functions PRXPARSE, >PRXMATCH, PRXCHANGE, and PRXPOSN. > >PRX Function Reference: >http://support.sas.com/rnd/base/topics/datastep/perl_regexp/regexp2.html > >These seem rather complicated unless you are already a PERL user, and I've >never used them, but they seem powerful enough to use for even the most >complicated fuzzy string searches.

No, they're really a piece of cake! Trust me!

Just because people keep saying Perl is a write-once/read-never language... :-)

Seriously, the PRX... functions are easier to learn than the RX... functions, because there is a lot more in the way of resources for the Perl regular expressions. You can go on the internet and I'll guess that you could search for and find a dozen free Perl regex tutorials in seconds.

Plus, the Perl regexen are relatively intuitive (at least for me), with basic rules like

/Jen/ matches any string with 'Jen' in it /(Jen|Jennifer)/ matches any string with 'Jen' or 'Jennifer'

If you're used to using () to group stuff in SAS, and | as a logical OR, then you're already halfway there.

HTCT (Happy To Cause Trouble), David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

_________________________________________________________________ Donít just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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