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 (January 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 24 Jan 2005 11:40:03 -0800
Reply-To:     cassell.david@EPAMAIL.EPA.GOV
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "David L. Cassell" <cassell.david@EPAMAIL.EPA.GOV>
Subject:      Re: Looking for something equivalent to RTRIM
In-Reply-To:  <446DDE75CFC7E1438061462F85557B0F088E8200@remail2.westat.com>
Content-type: text/plain; charset=US-ASCII

Mike Rhoads <RHOADSM1@WESTAT.COM> replied to Richard: > Very neat!

I agree.

> The 9.1.3 documentation suggests that PRXMATCH is now "smart" enough that > the expression compilation is only done once when it is passed as a > constant. Do you know whether or not that alleviates the memory problems > that you referred to in your earlier posting?

PRXMATCH(), as I understand it, *has* to do the expression compilation only once. I believe that the Perl regex option "/o" is used when passing the information to the Perl regex engine hidden under the hood, so the expression is evaluated once and used as is thereafter. Of course, this means that we can't use a lot of the cool Perl regex tricks that lurk out of sight. C'est la vie. :-)

As I understand it, this one-time compilation *should* alleviate the memory problems that were around. I'm sure Little Birdies will chirp their disapproval if I'm wrong.

As an additional point, I really don't recommend that anyone with less skill than Richard use this feature of PRXMATCH(). If you mess up your regex when you're putting your regex in PRXMATCH() {instead of using PRXPARSE() and some error-checking}, you will totally hose your entire data step or SQL step. I mean *completely*. If you want to match a regex and you mess it up madly enough, the resultant will be effectively *missing*, and you'll be matching when you have a missing value, not when you have a regular expression match. In my opinion, this is okay for learning, and fun to mess with, but potentially lethal in production code. As they say on tv, "KIDS, DON'T TRY THIS AT HOME." :-)

David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician


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