|
I agree with you on not using prxmatch unless well you have the guru status
of Richard. I personally put it up with using call peek and poke in
production code. Use only if there is no other way to get the job done, and
even then add a ton of documentation.
Toby Dunn
From: "David L. Cassell" <cassell.david@EPAMAIL.EPA.GOV>
Reply-To: cassell.david@EPAMAIL.EPA.GOV
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Looking for something equivalent to RTRIM
Date: Mon, 24 Jan 2005 11:40:03 -0800
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
|