<?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: If a table has multiple indices, can you call to only use one? (Like SQL WITH(INDEX())) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649930#M194881</link>
    <description>&lt;P&gt;IDXNAME= didn't work on my table but I did a proc contents and realized the SQL indices were not translating over to the SAS table &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Sort of a side question, but is it possible to create an index on a table you can't make any changes to?&amp;nbsp; &amp;nbsp;But in terms of the original question, your solution was spot on so thank you very much!&lt;/P&gt;</description>
    <pubDate>Fri, 22 May 2020 15:27:15 GMT</pubDate>
    <dc:creator>lawatkey</dc:creator>
    <dc:date>2020-05-22T15:27:15Z</dc:date>
    <item>
      <title>If a table has multiple indices, can you call to only use one? (Like SQL WITH(INDEX()))</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649918#M194877</link>
      <description>&lt;P&gt;I am trying to run some programs against a large table with many indices (that I do not have control over).&amp;nbsp; Is there a way to have SAS just choose 1 index, like you can in SQL?&amp;nbsp; &amp;nbsp;And is it possible that this makes a program more efficient, or is this just a waste of time?&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 14:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649918#M194877</guid>
      <dc:creator>lawatkey</dc:creator>
      <dc:date>2020-05-22T14:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: If a table has multiple indices, can you call to only use one? (Like SQL WITH(INDEX()))</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649924#M194880</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;read about: IDXNAME= Data Set Option and&amp;nbsp;IDXWHERE= Data Set Option&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=ledsoptsref&amp;amp;docsetTarget=p0y66t2zyidag8n1uivmrp3473it.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=ledsoptsref&amp;amp;docsetTarget=p0y66t2zyidag8n1uivmrp3473it.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=ledsoptsref&amp;amp;docsetTarget=p1wqokbcewdl6vn1eaxukhvar9ic.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=ledsoptsref&amp;amp;docsetTarget=p1wqokbcewdl6vn1eaxukhvar9ic.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 14:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649924#M194880</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-05-22T14:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: If a table has multiple indices, can you call to only use one? (Like SQL WITH(INDEX()))</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649930#M194881</link>
      <description>&lt;P&gt;IDXNAME= didn't work on my table but I did a proc contents and realized the SQL indices were not translating over to the SAS table &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Sort of a side question, but is it possible to create an index on a table you can't make any changes to?&amp;nbsp; &amp;nbsp;But in terms of the original question, your solution was spot on so thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 15:27:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649930#M194881</guid>
      <dc:creator>lawatkey</dc:creator>
      <dc:date>2020-05-22T15:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: If a table has multiple indices, can you call to only use one? (Like SQL WITH(INDEX()))</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649934#M194882</link>
      <description>This depends on how you're connecting and viewing the data. After you extract the data you won't have any indexes. But SAS should use the DB indexes if they exist. If you really want to make it efficient explicit SQL pass through is likely your best bet, as you can use the native language and the indexes as desired. Implicit works fairly well, you can have the log show the full information of the SQL code so that you can see if the indexes are used. There's ways to do all of this in SAS but I can't remember the exact code but maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt; does &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Fri, 22 May 2020 15:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/649934#M194882</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-22T15:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: If a table has multiple indices, can you call to only use one? (Like SQL WITH(INDEX()))</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/650010#M194908</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;suggested you could use pass through, syntax is more or less as follows (but do check documentation for the details):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  /* start connection to some database &amp;lt;engine&amp;gt; e.g. Teradata, Oracle, Postgers */
  connect to &amp;lt;ENGINE&amp;gt; as DB (user="user" password="password" database="database" server="123.123.123.123");


  create table WORK.LOCAL AS /* create local table */
      (
      select * from connection to DB /* with pass through to database with databale native SQL */
          (
              select A.id, A.x, B.y 
              from Exteranal1 A 
              join External2 B 
              on A.id = B.id
          )
      );

  disconnect from BD;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 20:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-a-table-has-multiple-indices-can-you-call-to-only-use-one/m-p/650010#M194908</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-05-22T20:36:08Z</dc:date>
    </item>
  </channel>
</rss>

