BookmarkSubscribeRSS Feed

https://communities.sas.com/t5/SAS-Data-Management/How-do-I-get-regular-expressions-functions-in-PRO...

 

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!

Access Violation? is the error that needs to be better explained.

3 Comments
SASKiwi
PROC Star

A search in SAS Support will reveal over 500 SAS Notes regarding Access Violations. These errors occur when SAS does not "gracefully" handle a particular software issue so a generic error message is provided instead.

 

I think it would be helpful to provide a more descriptive generic error message, but it would be near impossible provide detailed explanations of all possible scenarios.

ballardw
Super User

Where did you find an example of syntax like:

FROM someDatabase.someSchema.someTable;

 

I think you need to examine the examples more closely for how libraries are assigned to use schema in a connection.

I believe even Proc FEDSQL wants LIBNAME.MEMNAME syntax. The third element may get into the realm of SAS SCL and terribly confuses the program as to what you are attempting.

ccaulkins912
Obsidian | Level 7

@ballardw , I got it from your SAS documentation or someboy who had a question. I agree with @SASKiwi but in this case there is a way and in most cases if you are a programmer with some experience coding to the tester and documenting for future releases, there's almost always a way to be a tad bit more specific as to the error that was generated.