<?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: How to call a stored procedure on Redshift from SAS? in Advanced Programming</title>
    <link>https://communities.sas.com/t5/Advanced-Programming/How-to-call-a-stored-procedure-on-Redshift-from-SAS/m-p/751839#M96</link>
    <description>&lt;P&gt;External database stored procedures have to be run using the EXECUTE statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL noerrorstop;
connect to SASIORST( READBUFF=10000 DSN=DBSTG USER=sas PASSWORD="******");
execute (call mccm.proc_temp) by SASIORST;
disconnect from SASIORST;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However you can't read a result set from EXECUTE. If the stored procedure is producing a result set then it needs to be changed so a table or view is created instead. Then this table can be read in a following SELECT statement.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 23:57:19 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-07-02T23:57:19Z</dc:date>
    <item>
      <title>How to call a stored procedure on Redshift from SAS?</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/How-to-call-a-stored-procedure-on-Redshift-from-SAS/m-p/751782#M95</link>
      <description>&lt;P&gt;I'm trying to call a stored procedure on redshift from SAS, and I am running into the below error. Could someone please help me with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL noerrorstop;&lt;BR /&gt;connect to SASIORST( READBUFF=10000 DSN=DBSTG USER=sas PASSWORD="******");&lt;BR /&gt;create table work.test as&lt;BR /&gt;select * from connection to SASIORST&lt;BR /&gt;(call mccm.proc_temp);&lt;BR /&gt;disconnect from SASIORST;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: CLI prepare error: [SAS][ODBC Redshift Wire Protocol driver][Redshift]ERROR: syntax error at end of input(Position 20; File&lt;BR /&gt;/home/ec2-user/padb/src/pg/src/backend/parser/parser_scan.l; Line 711; Routine yyerror; )&lt;BR /&gt;SQL statement: call mccm.proc_temp.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 16:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/How-to-call-a-stored-procedure-on-Redshift-from-SAS/m-p/751782#M95</guid>
      <dc:creator>david999</dc:creator>
      <dc:date>2021-07-02T16:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a stored procedure on Redshift from SAS?</title>
      <link>https://communities.sas.com/t5/Advanced-Programming/How-to-call-a-stored-procedure-on-Redshift-from-SAS/m-p/751839#M96</link>
      <description>&lt;P&gt;External database stored procedures have to be run using the EXECUTE statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL noerrorstop;
connect to SASIORST( READBUFF=10000 DSN=DBSTG USER=sas PASSWORD="******");
execute (call mccm.proc_temp) by SASIORST;
disconnect from SASIORST;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However you can't read a result set from EXECUTE. If the stored procedure is producing a result set then it needs to be changed so a table or view is created instead. Then this table can be read in a following SELECT statement.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 23:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Advanced-Programming/How-to-call-a-stored-procedure-on-Redshift-from-SAS/m-p/751839#M96</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-07-02T23:57:19Z</dc:date>
    </item>
  </channel>
</rss>

