BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tomcmacdonald
Quartz | Level 8

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
4 REPLIES 4
AhmedAl_Attar
Ammonite | Level 13

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

ccaulkins912
Obsidian | Level 7

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

Cheers,

 

Chad Caulkins

AhmedAl_Attar
Ammonite | Level 13
Hey,

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

Ahmed
AnnaBrown
Community Manager

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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

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