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 (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 19:44:48 +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: Looking for something equivalent to RTRIM
Comments:   To: cassell.david@EPAMAIL.EPA.GOV
In-Reply-To:   <OFF4836AA0.5270DB70-ON88256F93.006B3842-88256F93.006C09A9@epamail.epa.gov>
Content-Type:   text/plain; format=flowed

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


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