Date: Mon, 19 Jun 2006 10:53:59 -0600
Reply-To: Alan Churchill <SASL001@SAVIAN.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Alan Churchill <SASL001@SAVIAN.NET>
Subject: Do regular expressions need to be declared in _n_=1
Content-Type: text/plain; charset="iso-8859-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
|