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?