<?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 run stored SQL procedure at SAS when DSN is at server level?--Urgent help please! in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/367821#M11104</link>
    <description>Thank you!</description>
    <pubDate>Fri, 16 Jun 2017 17:31:04 GMT</pubDate>
    <dc:creator>Jade_SAS</dc:creator>
    <dc:date>2017-06-16T17:31:04Z</dc:date>
    <item>
      <title>How to run stored SQL procedure at SAS when DSN is at server level?--Urgent help please!</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/366753#M11060</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I used to run the stored SQL procedure via the following code, everything works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&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; SQLSVR (dsn=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&lt;FONT color="#000000"&gt;&lt;STRONG&gt;SQL_Database_name&lt;/STRONG&gt;&lt;/FONT&gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; uid=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"***"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; pwd=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&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;EXECUTE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (HT.pLoadtest) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SQLSVR; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;Quit&lt;/FONT&gt;&lt;/STRONG&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Recently the SAS admin re-defined the dsn&amp;nbsp;on the SAS server, current dsn is defined at SQL&amp;nbsp;server level, the previous dsn (that at SQL database level) does not exist any more.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I know we can add "Qualifier" in the Libname statement when the DATASRC is defined at SQL_Server level (See details below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;LIBNAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SQLSVR&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATASRC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&lt;STRONG&gt;&lt;FONT color="#000000"&gt;SQL_Server_name&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Qualifier&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;STRONG&gt;&lt;FONT color="#000000"&gt;SQL_Database_name&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;schema&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=HT &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;user&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"***"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;password&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&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;&amp;nbsp;&amp;nbsp; But I don't know what we should add the to PROC SQL pass throught process to get the stored SQL procedure (at HT schema)work.&amp;nbsp;I tried the following coding and got an error, the error said "could not find stored procedureHT.ploadtest.....&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;PROC&lt;/FONT&gt;&lt;/STRONG&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; SQLSVR (dsn=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&lt;FONT color="#000000"&gt;&lt;STRONG&gt;SQL_Server_name&lt;/STRONG&gt;&lt;/FONT&gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; uid=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"***"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; pwd=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&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;EXECUTE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (HT.pLoadtest) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SQLSVR; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;Quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Is there anything we can do to make the above coding work? Or the DSN has be be defined at the database level for the EXECUTE stored SQL procedure purpose?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thank you so much!!!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Jade&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 19:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/366753#M11060</guid>
      <dc:creator>Jade_SAS</dc:creator>
      <dc:date>2017-06-13T19:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to run stored SQL procedure at SAS when DSN is at server level?--Urgent help please!</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/366773#M11061</link>
      <description>&lt;P&gt;Have you checked that you're connecting to the daabase properly? Ie does a select work before trying to run a stored proc.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 20:51:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/366773#M11061</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-13T20:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to run stored SQL procedure at SAS when DSN is at server level?--Urgent help please!</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/366775#M11062</link>
      <description>&lt;P&gt;You should be able to prefix your server, database and schema to your stored procedure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;EXECUTE (MySQLServer.MyDatabase.HT.pLoadtest) by SQLSVR;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Jun 2017 20:56:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/366775#M11062</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-06-13T20:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to run stored SQL procedure at SAS when DSN is at server level?--Urgent help please!</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/367821#M11104</link>
      <description>Thank you!</description>
      <pubDate>Fri, 16 Jun 2017 17:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-run-stored-SQL-procedure-at-SAS-when-DSN-is-at-server/m-p/367821#M11104</guid>
      <dc:creator>Jade_SAS</dc:creator>
      <dc:date>2017-06-16T17:31:04Z</dc:date>
    </item>
  </channel>
</rss>

