DATA Step, Macro, Functions and more

How to use a PROC DS2 package method more than once in a PROC FEDSQL query?

Reply
Frequent Contributor
Posts: 99

How to use a PROC DS2 package method more than once in a PROC FEDSQL query?

[ Edited ]

I'm receiving the following error messages:

 

 

ERROR: Access Violation occurred during PREPARE!

When trying to invoke this method twice:

 

 

 

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

 

In this query:

 

PROC FEDSQL;
	DROP TABLE tableA FORCE;
	CREATE TABLE tableA (
		id VARCHAR(11)
	);
	INSERT INTO tableA 
	SELECT id
	FROM someDatabase.someSchema.tableZ
	WHERE regexp.match('/^[0-9]{11}/', bble_docref_id) = 1
	UNION 
	SELECT id
	FROM someDatabase.someSchema.tableY
	WHERE regexp.match('/^[0-9]{11}/', bble_docref_id) = 1;
QUIT;

Removing either one of the WHERE statements doesn't throw an error.  How can I use the method twice or more without SAS throwing an error?

Ask a Question
Discussion stats
  • 0 replies
  • 97 views
  • 0 likes
  • 1 in conversation