BookmarkSubscribeRSS Feed
tomcmacdonald
Quartz | Level 8

 

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


PROC FEDSQL;
	CREATE TABLE example (
		id VARCHAR(11)
	);
QUIT;

PROC FEDSQL;
	INSERT INTO example
	SELECT
		CASE LENGTH(id)
			WHEN 11 THEN SUBSTRING(id FROM 1 FOR 6) || SUBSTRING(id FROM 8 FOR 4)
			WHEN 12 THEN SUBSTRING(id FROM 1 FOR 6) || SUBSTRING(id FROM 8 FOR 5)
		END AS id
	FROM MYDATABASE.MYSCHEMA.MYTABLE
	WHERE regexp.match('/[0-9]+/', id) = 1 AND regexp.match('/[A-Z]+/', id) = 0;
QUIT;

 

Throws this error:

 

ERROR: Access Violation occurred during PREPARE!

What do I have to do to avoid this error? 

 

1 REPLY 1
SASKiwi
PROC Star

I note you've posted several times for the same subject. You would be better off opening a track to SAS Technical Support and report all of your DS2 access violation problems to them. They are in the best position to help.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 637 views
  • 1 like
  • 2 in conversation