<?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: Can you use a local table in a passthrough? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114939#M23687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom is correct.&amp;nbsp; In point of fact, since the pass-through facility sends raw, or native, SQL to the data base nothing that is strictly SAS will work.&amp;nbsp; I do not have the capability at the moment to do any testing so I don't know which would be the most efficient but you have three choices:&amp;nbsp; (1)&amp;nbsp; Run the query and then the data step to join your data sets, (2) do as Tom suggested (if possible) and put the SAS data set in a macro variable and use that in your query and (3) don't use the pass-through facility - that would enable you to call from both the Oracle table and the existing SAS data set - SAS would determine which part(s) of the query to pass to the data&amp;nbsp; base.&amp;nbsp; I am guessing (3) might be the most efficient in the long run but do not know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2012 20:07:47 GMT</pubDate>
    <dc:creator>JerryH</dc:creator>
    <dc:date>2012-09-10T20:07:47Z</dc:date>
    <item>
      <title>Can you use a local table in a passthrough?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114936#M23684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like the title states, is it possible to use a local dataset in the work directory in a passthrough?&amp;nbsp; I was not sure if you could use it as a temp table in someway.&amp;nbsp; I have to use a passthrough to query data and would like to use a dataset created in SAS with the query.&amp;nbsp; It is possible for me to pull in the data I need using the passthrough and then use a proc sql statement to utilize the local dataset but the process would be much more efficient if it was possible to just use the data in the passthrough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2012 15:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114936#M23684</guid>
      <dc:creator>lsirakos</dc:creator>
      <dc:date>2012-09-07T15:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use a local table in a passthrough?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114937#M23685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think so. If I understand it correctly, passthrough will send the code directly to a (non-SAS) database server, which will execute the code. I can't see how your database server would know what to do with a SAS dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are absolutely correct that it may be much more efficient to reduce the size of the returned data in the&amp;nbsp; database server. If your SAS temp dataset is just a list of join values that you want to select from your big table, consider putting them into a macro variable, which you can use as WHERE var IN(&amp;amp;macrovariable). This might quite fast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the feeling there's a SAS/Access option that will tell SAS to do this automatically, but I can't find it offhand. (Anybody out there know the name of this?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another option is to load your SAS temp dataset to the database, and then you can implement the join as a passthrough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2012 16:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114937#M23685</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2012-09-07T16:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use a local table in a passthrough?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114938#M23686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom, that is what I figured.&amp;nbsp; I didn't know if you were using a passthrough to connect to a SQL Server if it would be possible to pass the local dataset in as a temporary table or something along those lines.&amp;nbsp; The problem with loading the data into the database is I only have read access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2012 16:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114938#M23686</guid>
      <dc:creator>lsirakos</dc:creator>
      <dc:date>2012-09-07T16:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use a local table in a passthrough?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114939#M23687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom is correct.&amp;nbsp; In point of fact, since the pass-through facility sends raw, or native, SQL to the data base nothing that is strictly SAS will work.&amp;nbsp; I do not have the capability at the moment to do any testing so I don't know which would be the most efficient but you have three choices:&amp;nbsp; (1)&amp;nbsp; Run the query and then the data step to join your data sets, (2) do as Tom suggested (if possible) and put the SAS data set in a macro variable and use that in your query and (3) don't use the pass-through facility - that would enable you to call from both the Oracle table and the existing SAS data set - SAS would determine which part(s) of the query to pass to the data&amp;nbsp; base.&amp;nbsp; I am guessing (3) might be the most efficient in the long run but do not know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 20:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-you-use-a-local-table-in-a-passthrough/m-p/114939#M23687</guid>
      <dc:creator>JerryH</dc:creator>
      <dc:date>2012-09-10T20:07:47Z</dc:date>
    </item>
  </channel>
</rss>

