SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How do I get regular expressions functions in PROC FEDSQL?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 107
Accepted Solution

How do I get regular expressions functions in PROC FEDSQL?

I am running SAS 9.04.01M3P062415 on UNIX.  I do no have predefined packages PCRXMATCH and PCRXFIND available to me.  How can I have regular expressions functionality with PROC FEDSQL?  The following code fails:

 

 

PROC DS2;
	package regexp /overwrite=yes;
		method match(varchar(1024) pattern, varchar(1024) string) returns varchar(1024);
			return prxmatch(pattern, string);
		end;
	endpackage;
	run;
QUIT;


PROC FEDSQL;
	CREATE TABLE foo AS 
	SELECT 
		regexp.match('/[0-9]+/', id) AS test1, 
		regexp.match('/[A-Z]+/', id) AS test 
	FROM someDatabase.someSchema.someTable;
QUIT;

 

With an error message of:

 

ERROR: Access Violation occurred during PREPARE!

I can use the above function once in a query but not more than once?  How can I get around this?

 

 


Accepted Solutions
Solution
‎06-21-2018 05:41 PM
Super Contributor
Posts: 288

Re: How do I get regular expressions functions in PROC FEDSQL?

Posted in reply to tomcmacdonald

Hi @tomcmacdonald

 

Try this Trick from @SASJedi (Mark Jordan)'s Book Mastering the SAS DS2 Procedure: Advanced Data-Wrangling Techniques, Second Edition, 5.2.2 FCMP Package Example

 

 

Hope it helps,

Ahmed

View solution in original post


All Replies
Solution
‎06-21-2018 05:41 PM
Super Contributor
Posts: 288

Re: How do I get regular expressions functions in PROC FEDSQL?

Posted in reply to tomcmacdonald

Hi @tomcmacdonald

 

Try this Trick from @SASJedi (Mark Jordan)'s Book Mastering the SAS DS2 Procedure: Advanced Data-Wrangling Techniques, Second Edition, 5.2.2 FCMP Package Example

 

 

Hope it helps,

Ahmed

Occasional Contributor
Posts: 14

Re: How do I get regular expressions functions in PROC FEDSQL?

Posted in reply to AhmedAl_Attar

hey, friend Ahmed -
don't you think the error message could be more descriptive?

Cheers,

 

Chad Caulkins

Super Contributor
Posts: 288

Re: How do I get regular expressions functions in PROC FEDSQL?

Posted in reply to ccaulkins912
Hey,

I would agree, let's hope SAS's R&D team are looking at this entry.

Ahmed
Community Manager
Posts: 746

Re: How do I get regular expressions functions in PROC FEDSQL?

Posted in reply to AhmedAl_Attar

Hi there,

 

The SAS Data Management team monitors this community, so rest assured it is aware of this request. You can also add an idea to the SASWare Ballot to more officially submit it .

 

Best,

Anna

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 185 views
  • 1 like
  • 4 in conversation