<?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: SQL Passthrough in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686816#M208455</link>
    <description>&lt;P&gt;Ok implemented some of this and consulted with the original writer and there were some SQL syntax issues to correct. Following that the code executes but but not completely. The log is shown below. Is this a SQL Server ODBC driver issue? What is with the odd characters?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DBC: ROLLBACK performed on connection 8.&lt;BR /&gt;&lt;BR /&gt;Summary Statistics for ODBC are:&lt;BR /&gt;Total SQL execution seconds were: 61.562277&lt;BR /&gt;Total SQL describe seconds were: 0.000015&lt;BR /&gt;Total seconds used by the ODBC ACCESS engine were 61.563385&lt;BR /&gt;&lt;BR /&gt;ERROR: CLI describe error:&lt;BR /&gt;䵛捩潲潳瑦孝䑏䍂䐠楲敶⁲㜱映牯匠䱑匠牥敶嵲卛䱑匠牥敶嵲湉慶楬⁤扯敪瑣渠浡⁥搧潢愮瑲捩&lt;BR /&gt;灩湡却慴畴味灹䱥潯畫❰.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;717 disconnect from wex;&lt;BR /&gt;NOTE: Statement not executed due to NOEXEC option.&lt;BR /&gt;718 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 1:01.82&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 19:36:26 GMT</pubDate>
    <dc:creator>Doug____</dc:creator>
    <dc:date>2020-09-25T19:36:26Z</dc:date>
    <item>
      <title>SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686545#M208350</link>
      <description>&lt;P&gt;In using the following code, an "error" box is returned each time that says :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cannot open data set "XXX".&lt;/P&gt;&lt;P&gt;SQL View Work.XXX could not be processed because at least one of the data sets, or views reference directly (or indirectly) but it could not be located or opened successfully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when I execute the code shown below, it runs fine and returns records, but if I want to keep it in a temp table using the #TABLENAME syntax, it returns the message shown above.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;U&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;connect&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;to&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; odbc &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; AAA(datasrc=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"64bit AAAA"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; user=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"YYYYY"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; password=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"ZZZZZ"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;create&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;view&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; XXX &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; * &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; connection to AAA&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; * &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; eav.vw_PRCF&lt;/FONT&gt;);&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;disconnect&lt;/FONT&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; AAA;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I cannot create tables of any kind or the message above is returned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 21:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686545#M208350</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2020-09-24T21:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686546#M208351</link>
      <description>&lt;P&gt;I don't know what you mean by the "&lt;SPAN&gt;&amp;nbsp;#TABLENAME syntax".&amp;nbsp; If you replace the word "view" with "table" it will create a table.&amp;nbsp; You will get an error if there is already a view with that name as SAS will not automatically delete a view.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 21:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686546#M208351</guid>
      <dc:creator>CurtisMackWSIPP</dc:creator>
      <dc:date>2020-09-24T21:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686559#M208359</link>
      <description>&lt;P&gt;When I issue the code below in pass&amp;nbsp;through&amp;nbsp;it returns the box that says it can't find it and no table is created.&lt;/P&gt;&lt;P&gt;create table #a&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(id char(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#08726d"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;ind_id int,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;account_id int,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;integration_id varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;employer_id int,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;name varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;LAST_TRANSFER_DATE datetime,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;NBR_TRANSFERS varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;SHORT_NAME varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;INVESTMENT_ACTIVE varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;OFFICER_CODE varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;4000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;OFFICER_NAME varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;200&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;CLOSE_DATE Datetime,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;ACCOUNT_ORIG varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;4000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;DATE7_ENTERED varchar(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#08726d"&gt;25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 22:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686559#M208359</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2020-09-24T22:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686566#M208365</link>
      <description>&lt;P&gt;This is what I have in mind.&amp;nbsp; Does it not work in your environment?&amp;nbsp; I am not understanding the # you are using.&amp;nbsp; It could be my ignorance however.&amp;nbsp; I know that notation creates a temporary table in SQL Server.&amp;nbsp; Is that what you are trying to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

connect to odbc as AAA(datasrc="64bit AAAA" user="YYYYY" password="ZZZZZ");
create table Wanted as
select * from connection to AAA
(select * from eav.vw_PRCF);
disconnect from AAA;

quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Sep 2020 22:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686566#M208365</guid>
      <dc:creator>CurtisMackWSIPP</dc:creator>
      <dc:date>2020-09-24T22:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686568#M208367</link>
      <description>&lt;P&gt;Please post your complete SAS log including the code and any notes and errors. Posting partial code and not the actual errors makes it hard to see what is actually going on.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 22:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686568#M208367</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-24T22:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686581#M208378</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10429"&gt;@Doug____&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I issue the code below in pass&amp;nbsp;through&amp;nbsp;it returns the box that says it can't find it and no table is created.&lt;/P&gt;
&lt;P&gt;create table #a&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(id char(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#08726d"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can't create a table in SQL passthrough that starts with &lt;FONT face="courier new,courier"&gt;select&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;For anything but select clauses, use &lt;FONT face="courier new,courier"&gt;execute by &lt;EM&gt;xxx ()&lt;/EM&gt;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;instead of &lt;FONT face="courier new,courier"&gt;select from connection to&lt;EM&gt; xxx ()&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 00:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686581#M208378</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-25T00:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686816#M208455</link>
      <description>&lt;P&gt;Ok implemented some of this and consulted with the original writer and there were some SQL syntax issues to correct. Following that the code executes but but not completely. The log is shown below. Is this a SQL Server ODBC driver issue? What is with the odd characters?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DBC: ROLLBACK performed on connection 8.&lt;BR /&gt;&lt;BR /&gt;Summary Statistics for ODBC are:&lt;BR /&gt;Total SQL execution seconds were: 61.562277&lt;BR /&gt;Total SQL describe seconds were: 0.000015&lt;BR /&gt;Total seconds used by the ODBC ACCESS engine were 61.563385&lt;BR /&gt;&lt;BR /&gt;ERROR: CLI describe error:&lt;BR /&gt;䵛捩潲潳瑦孝䑏䍂䐠楲敶⁲㜱映牯匠䱑匠牥敶嵲卛䱑匠牥敶嵲湉慶楬⁤扯敪瑣渠浡⁥搧潢愮瑲捩&lt;BR /&gt;灩湡却慴畴味灹䱥潯畫❰.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;717 disconnect from wex;&lt;BR /&gt;NOTE: Statement not executed due to NOEXEC option.&lt;BR /&gt;718 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 1:01.82&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 19:36:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686816#M208455</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2020-09-25T19:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686856#M208467</link>
      <description>&lt;P&gt;Your SAS log does not contain any source (program) statements so is useless for diagnosing what is happening. If that is your complete log, then you need to add this at the start of your program, then rerun and re-post your log including source statements:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options source;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Sep 2020 23:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686856#M208467</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-25T23:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686872#M208476</link>
      <description>&lt;P&gt;Don't specify the number of decimals in the format to read digits, unless you want to force the number of decimals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 08:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Passthrough/m-p/686872#M208476</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-26T08:50:56Z</dc:date>
    </item>
  </channel>
</rss>

