<?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: Integration med MS SQL Stored procedure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/375379#M276316</link>
    <description>Well, I'm Swedish so perhaps it's not that impressive..&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;.&lt;BR /&gt;Code looks fine by the eye.&lt;BR /&gt;Since the messaging communication is specific for the SAS/ACCESS engine and the target database, I suspect that not much can be done.&lt;BR /&gt;Perhaps you need to check with SAS tech support for verification.</description>
    <pubDate>Wed, 12 Jul 2017 15:31:27 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2017-07-12T15:31:27Z</dc:date>
    <item>
      <title>Integration med MS SQL Stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/374408#M276313</link>
      <description>&lt;P&gt;Hej SAS folk&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Det er lykkedes mig at kalde en stored procedure&amp;nbsp;i en Microsoft SQL database med en parameter, som får proceduren til at eksekvere sin kode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fejler proceduren, får jeg en ret intetsigende besked i loggen i SAS. &lt;STRONG&gt;Er der nogen måde man kan programmere i SAS, så man får den egentlige fejlbesked fra SQL vist i SAS?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeg benytter denne kode:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CONNECT&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; odbc &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sql (NOPROMPT=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'DRIVER=SQL Server; SERVER=testsqlsrv1; DATABASE=xxxx'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;execute&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (FjernDatasaetLaas &amp;amp;datasetnavn)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sql;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DISCONNECT&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sql;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Mvh&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Martin&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 09:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/374408#M276313</guid>
      <dc:creator>MartinJeppesen</dc:creator>
      <dc:date>2017-07-10T09:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Integration med MS SQL Stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/374450#M276314</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;
&lt;P&gt;even not stated explicitly, this forum is mainly English written. If you are more comfortable with Scandinavian, try the Regional Groups/SAS Community Nordic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried SQLXMSG? Don't think there are any other options as long&amp;nbsp;you wish to call from SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="n0cba9pn9gpj0ln1y1oku3i0obcq" class="xis-paragraph"&gt;The &lt;A id="GTp06fu6ubw2iqmtn1im3027hls990" class="glossTerm" target="_blank"&gt;&lt;/A&gt;SQL pass-through facility generates return codes and error messages that are available to you through these SAS macro variables:&lt;/DIV&gt;
&lt;DIV id="p0h6esauw4urfgn12pu149jzwr2s" class="xis-paragraph"&gt;
&lt;DIV class="xis-listTermDef"&gt;
&lt;DIV id="n1b4uzvrxlnszpn12swvg1y6ls0e" class="xis-termDefPair"&gt;
&lt;DIV class="xis-paraSimpleFirst"&gt;&lt;STRONG&gt;SQLXMSG&lt;/STRONG&gt; contains DBMS-specific error messages.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="p0lge0r8u2yiimn1ts3eh7d9hmm5" class="xis-termDefPair"&gt;
&lt;DIV class="xis-paraSimpleFirst"&gt;&lt;STRONG&gt;SQLXRC&lt;/STRONG&gt; contains DBMS-specific error codes.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="p1m4w94xixcj2qn1s9y4h6v51vf8" class="xis-paragraph"&gt;You can use SQLXMSG and SQLXRC only through &lt;A id="GTp0wi2d97obbmymn1aodxa08q108b" class="glossTerm" target="_blank"&gt;&lt;/A&gt;explicit pass-through with the SQL pass-through facility. &lt;SPAN class="xis-xrefSee"&gt;&lt;SPAN class="xis-xrefText"&gt;See &lt;/SPAN&gt;&lt;A title="" href="http://support.sas.com/documentation/cdl/en/acreldb/69580/HTML/default/n0jhd9y0wb161rn1gp04zvjdqak7.htm#p0pc9h240pnmlwn1it24smnin7i7" target="_blank"&gt;Return Codes&lt;/A&gt;&lt;SPAN class="xis-xrefText"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV id="n0cau71avagfpln1le0npsvvc1fa" class="xis-paragraph"&gt;You can print the contents of SQLXMSG and SQLXRC in the SAS log by using the %PUT macro. SQLXMSG is reset to a blank string, and SQLXRC is reset to 0 when any SQL pass-through facility statement is executed.&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Jul 2017 11:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/374450#M276314</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-07-10T11:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Integration med MS SQL Stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/375306#M276315</link>
      <description>&lt;P&gt;Hi Linus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your fast reply&amp;nbsp;and aplogies for not writing in english in the first place. But impressive still that you actually understood the question!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure how to use the macro variables, because they do not give me any messages in the log. I have implemented them in this way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CONNECT&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; odbc &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sql (NOPROMPT=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'DRIVER=SQL Server; SERVER=testsqlsrv1; DATABASE=xxxx'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;execute&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (FjernDatasaetLaas &amp;amp;datasetnavn)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sql;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DISCONNECT&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sql;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;SQLXMSG;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;SQLXRC;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;And the log shows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 %_eg_hidenotesandsource;&lt;/P&gt;
&lt;P&gt;5 %_eg_hidenotesandsource;&lt;/P&gt;
&lt;P&gt;31&lt;/P&gt;
&lt;P&gt;32 PROC SQL;&lt;/P&gt;
&lt;P&gt;33 CONNECT TO odbc as sql (NOPROMPT=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX);&lt;/P&gt;
&lt;P&gt;34 execute (FjernDatasaetLaas &amp;amp;datasetnavn)&lt;/P&gt;
&lt;P&gt;35 by sql;&lt;/P&gt;
&lt;P&gt;NOTE: No data found/modified.&lt;/P&gt;
&lt;P&gt;36 DISCONNECT FROM sql;&lt;/P&gt;
&lt;P&gt;37 QUIT;&lt;/P&gt;
&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;
&lt;P&gt;real time 0.02 seconds&lt;/P&gt;
&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;38&lt;/P&gt;
&lt;P&gt;39 %put &amp;amp;SQLXMSG;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;40 %put &amp;amp;SQLXRC;&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;41&lt;/P&gt;
&lt;P&gt;42&lt;/P&gt;
&lt;P&gt;43 %_eg_hidenotesandsource;&lt;/P&gt;
&lt;P&gt;58&lt;/P&gt;
&lt;P&gt;59&lt;/P&gt;
&lt;P&gt;60 %_eg_hidenotesandsource;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know if my implementation is wrong or if something else is failing?&lt;/P&gt;
&lt;P&gt;Best wishes&lt;/P&gt;
&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 13:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/375306#M276315</guid>
      <dc:creator>MartinJeppesen</dc:creator>
      <dc:date>2017-07-12T13:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Integration med MS SQL Stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/375379#M276316</link>
      <description>Well, I'm Swedish so perhaps it's not that impressive..&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;.&lt;BR /&gt;Code looks fine by the eye.&lt;BR /&gt;Since the messaging communication is specific for the SAS/ACCESS engine and the target database, I suspect that not much can be done.&lt;BR /&gt;Perhaps you need to check with SAS tech support for verification.</description>
      <pubDate>Wed, 12 Jul 2017 15:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Integration-med-MS-SQL-Stored-procedure/m-p/375379#M276316</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-07-12T15:31:27Z</dc:date>
    </item>
  </channel>
</rss>

