<?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: SQLEXEC() function in PROC DS2 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/452785#M282706</link>
    <description>&lt;P&gt;SAS support knew about the problem. There&amp;nbsp;exists a feature request for getting this fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS support recommended using the SQLSTMT package.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 12:45:23 GMT</pubDate>
    <dc:creator>b1958</dc:creator>
    <dc:date>2018-04-10T12:45:23Z</dc:date>
    <item>
      <title>SQLEXEC() function in PROC DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/442141#M282703</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have the code shown below that puts an error in the log like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; delete from work._temp1 where a = 10
 -1
 ERROR: Error during execute of SQL statement: delete from work._temp1 where a = 10
 NOTE: Execution succeeded. No rows affected.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I can see it happens because I try to delete a record not found in the table. In the real case that I develop, this will certainly be the case from time to time. Is there any way I can avoid sas creating the ERROR:&lt;/P&gt;&lt;P&gt;If I do the same in PROC SQL, no ERROR appears in the log.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp1;
a=100;
run;

proc ds2 libs=work;
data _null_;
method run();
	declare varchar(500) sql;
	declare varchar (20) t;
	declare varchar(20) l;
	declare  varchar(5) n;
	declare int rc;
	t = '_temp1';
	l='work';
	n='10';
	sql = cat('delete from ',l, '.',t, ' where a = 10');
	put sql;	
	rc = sqlexec(sql);
	put rc ;
end;
enddata;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Mar 2018 10:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/442141#M282703</guid>
      <dc:creator>b1958</dc:creator>
      <dc:date>2018-03-04T10:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: SQLEXEC() function in PROC DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/442250#M282704</link>
      <description>&lt;P&gt;Same here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no workaround (option&amp;nbsp;SCOND=NONE seems ineffective), but would report it to tech support as a bug.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 06:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/442250#M282704</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-05T06:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQLEXEC() function in PROC DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/442611#M282705</link>
      <description>&lt;P&gt;There one workaround of course, but it can be very expensive in the absence of an index: run a few macros lines to test that a record exists before calling the delete statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 20:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/442611#M282705</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-05T20:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQLEXEC() function in PROC DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/452785#M282706</link>
      <description>&lt;P&gt;SAS support knew about the problem. There&amp;nbsp;exists a feature request for getting this fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS support recommended using the SQLSTMT package.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 12:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLEXEC-function-in-PROC-DS2/m-p/452785#M282706</guid>
      <dc:creator>b1958</dc:creator>
      <dc:date>2018-04-10T12:45:23Z</dc:date>
    </item>
  </channel>
</rss>

