Date: Mon, 19 Jun 2006 14:10:20 -0700
Reply-To: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject: Re: Do regular expressions need to be declared in _n_=1
In-Reply-To: <00d901c693c6$3afc51a0$b0f4f4e0$@net>
Content-Type: text/plain; charset="us-ascii"
Alan -
I believe Ron Cody agreed with your assessment in his presentation at
the final SUGI:
http://www2.sas.com/proceedings/sugi31/110-31.pdf
hth
Paul Choate
DDS Data Extraction
(916) 654-2160
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Alan
> Churchill
> Sent: Monday, June 19, 2006 10:32 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: Do regular expressions need to be declared in _n_=1
>
> Thank ken for the clarification.
>
> So it seems that the best bet is to use the _n_=1 method to make sure
the
> bases are always covered. That's what I needed to know.
>
> Alan
>
> Alan Churchill
> Savian "Bridging SAS and Microsoft Technologies"
> www.savian.net
>
>
> -----Original Message-----
> From: evilpettingzoo97@aol.com [mailto:evilpettingzoo97@aol.com]
> Sent: Monday, June 19, 2006 11:27 AM
> To: SASL001@savian.net; SAS-L@LISTSERV.UGA.EDU
> Subject: Re: Do regular expressions need to be declared in _n_=1
>
> Alan,
>
> The compile once behavior of the PRX functions occurs if you use the
/o
> modifier or in WHERE expressions. The /o modifier may not take in some
> cases when performing substitutions (with PRXCHANGE). Other than that,
the
> other options are if _n_=1 & retain or a DoW loop.
>
> HTH,
> Ken
>
> -----Original Message-----
> From: Alan Churchill <SASL001@SAVIAN.NET>
> To: SAS-L@LISTSERV.UGA.EDU
> Sent: Mon, 19 Jun 2006 10:53:59 -0600
> Subject: Do regular expressions need to be declared in _n_=1
>
> All,
>
> I seem to recall at the last SUGI that regular expression patterns are
> automatically retained and are only processed once in a data step. For
> example,
>
> Old Way:
>
> Data test ;
> Infile 'something or other' ;
> Input;
> Retain pattern ;
> If _n_ = 1 then
> Do ;
> Pattern = prxparse("/some regex/") ;
> End;
> Run ;
>
>
> Optional way:
>
> Data test ;
> Infile 'something or other' ;
> Input;
> Pattern = prxparse("/some regex/") ; Run ;
>
>
> Can anyone confirm this?
>
> Thanks,
> Alan
>
> Alan Churchill
> Savian "Bridging SAS and Microsoft Technologies"
> www.savian.net
>
>
>
________________________________________________________________________
> Check out AOL.com today. Breaking news, video search, pictures, email
and
> IM. All on demand. Always Free.
|