<?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: Proc SQL Pass Through Facility in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Pass-Through-Facility/m-p/322083#M71222</link>
    <description>&lt;P&gt;If that gives you trouble, apply %unquote:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;AND v&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;FONT color="#00FF00"&gt;%unquote(&lt;/FONT&gt;&lt;SPAN class="token macrostatement"&gt;%str&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;%&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;')&amp;amp;table_no%str(%'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;FONT color="#00FF00"&gt;)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 08:16:38 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-01-03T08:16:38Z</dc:date>
    <item>
      <title>Proc SQL Pass Through Facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Pass-Through-Facility/m-p/322066#M71209</link>
      <description>&lt;P&gt;&lt;STRONG&gt;%let table_no=EMP_HIST;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to oleDB as passThru&lt;BR /&gt;(properties=('Integrated Security'=SSPI 'Persist Security Info'=TRUE 'Initial Catalog'=DBDWH_EMP)&lt;BR /&gt;provider=SQLOLEDB PROMPT=NO DATASOURCE='DWH-I-SQL.DWHNET\DB01 schema=DWHDS);&lt;BR /&gt;create table work.temp_views as select&lt;BR /&gt;*&lt;BR /&gt;from connection to passThru (&lt;BR /&gt;SELECT&lt;BR /&gt;s.name as schema_name&lt;BR /&gt;,v.name as view_name&lt;BR /&gt;FROM sys.views v&lt;BR /&gt;,sys.schemas s&lt;BR /&gt;WHERE v.schema_id=s.schema_id&lt;BR /&gt;AND s.name like 'dwh'&lt;BR /&gt;AND v.name ="&amp;amp;table_no"&lt;BR /&gt;ORDER BY 1,2&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;disconnect from passThru;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Describe error: IColumnsInfo::GetColumnInfo failed. : Deferred prepare could not be&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;completed.: Statement(s) could not be prepared.: Invalid column name&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;'EMP_HIST'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question -I am ruuning the above code and it seems that code is resloving the macro varibale table no but due to pass through method it is showing above&amp;nbsp;error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should I write to run this code &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 05:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Pass-Through-Facility/m-p/322066#M71209</guid>
      <dc:creator>Rohit12</dc:creator>
      <dc:date>2017-01-03T05:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Pass Through Facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Pass-Through-Facility/m-p/322071#M71213</link>
      <description>&lt;P&gt;This is just a guess but some databases don't like double quotes so try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;AND v.name = %str(%')&amp;amp;table_no%str(%')&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jan 2017 06:27:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Pass-Through-Facility/m-p/322071#M71213</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-01-03T06:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Pass Through Facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Pass-Through-Facility/m-p/322083#M71222</link>
      <description>&lt;P&gt;If that gives you trouble, apply %unquote:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;AND v&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;FONT color="#00FF00"&gt;%unquote(&lt;/FONT&gt;&lt;SPAN class="token macrostatement"&gt;%str&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;%&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;')&amp;amp;table_no%str(%'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;FONT color="#00FF00"&gt;)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 08:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Pass-Through-Facility/m-p/322083#M71222</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-03T08:16:38Z</dc:date>
    </item>
  </channel>
</rss>

