<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ERROR: Access Violation occurred during PREPARE! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Access-Violation-occurred-during-PREPARE/m-p/472648#M121209</link>
    <description>&lt;P&gt;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.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jun 2018 23:53:44 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2018-06-22T23:53:44Z</dc:date>
    <item>
      <title>ERROR: Access Violation occurred during PREPARE!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Access-Violation-occurred-during-PREPARE/m-p/471199#M120672</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Throws this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ERROR: Access Violation occurred during PREPARE!&lt;/PRE&gt;&lt;P&gt;What do I have to do to avoid this error?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 19:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Access-Violation-occurred-during-PREPARE/m-p/471199#M120672</guid>
      <dc:creator>tomcmacdonald</dc:creator>
      <dc:date>2018-06-18T19:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Access Violation occurred during PREPARE!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Access-Violation-occurred-during-PREPARE/m-p/472648#M121209</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 23:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Access-Violation-occurred-during-PREPARE/m-p/472648#M121209</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-06-22T23:53:44Z</dc:date>
    </item>
  </channel>
</rss>

