<?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: Question about using indexes in SAS data steps in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214716#M39636</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;Hi Kurt,&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;I give you an example with a composite index that it's noy using the index in the data setp and I don't undetstannd why..&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;Thanks in advance.&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;----&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;%let fecha_ini = %sysevalf(%sysfunc(date()) - 900);&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;%let fecha2 = %sysfunc(date());&lt;BR /&gt;%let fecha1 = %sysevalf(%sysfunc(date()) - 10);&lt;BR /&gt;%let producto1 = P100;&lt;BR /&gt;%let producto2 = P1000;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;%put fecha_ini = &amp;amp;fecha_ini;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;data ventas(drop=i);&lt;BR /&gt;do i=1 to 10000000;&lt;BR /&gt;fecha = &amp;amp;fecha_ini + round(900*ranuni(1));&lt;BR /&gt;cod_producto = compress('P'||round(ranuni(1)*10000));&lt;BR /&gt;hc_importe = round(ranuni(1)*1000);&lt;BR /&gt;format fecha ddmmyyn8.;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;options msglevel=i;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;proc contents data=ventas;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;run;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;/* index */&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;proc sql;&lt;BR /&gt;create index i_ventas on ventas (fecha, cod_producto);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;data salida; &lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;set ventas;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;where fecha = &amp;amp;fecha1 and cod_producto = "&amp;amp;producto1";&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Jun 2015 14:58:13 GMT</pubDate>
    <dc:creator>juanvg1972</dc:creator>
    <dc:date>2015-06-28T14:58:13Z</dc:date>
    <item>
      <title>Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214708#M39628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;I am trying to work with SAS index in order to get better performance getting data from SAS datasets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;index&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; campo3 &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; prueba (campo3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: black; background: white;"&gt;I didn't get better performance in a query which where clause has only one field and this is the field of the index (campo3).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: black; background: white;"&gt;I would need some advices about index use.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: black; background: white;"&gt;I have read these:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: black; background: white;"&gt;- Use index in fileds with no many different values&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: black; background: white;"&gt;- Use index when the result of the sql is less than 20% oh whole table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: black; background: white;"&gt;- ¿¿¿????&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: black; background: white;"&gt;Any advice about using SAS index to get better perfomance will be greatly appreciatted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 11.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 10:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214708#M39628</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2015-06-26T10:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214709#M39629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An index can help you greatly if it is able to reduce the overall I/O needed.&lt;/P&gt;&lt;P&gt;It is not a replacement for sorting a dataset if you plan on using it completely (in this case you read the whole index AND the whole dataset, and the whole dataset randomly, so your performance is actually decreased)&lt;/P&gt;&lt;P&gt;Another point: if it is to be expected that each page in the dataset (or most of the pages, anyway) holds at least one record that matches your where condition, then the index cannot help, as you still need to read all pages and therefore the whole dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which query did you want to do, and have you already tried using sort and a data step?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 10:37:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214709#M39629</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-06-26T10:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214710#M39630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kurt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above the code I am using trying to learn how to use indexes.&lt;/P&gt;&lt;P&gt;I don' want to do sorts because my input datasets is large.&lt;/P&gt;&lt;P&gt;How can I see and manage 'pages'?, I don't know how to....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This is my dataset */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data prueba(drop = i);&lt;/P&gt;&lt;P&gt;do i = 1 to 50000000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo1='abc';&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo2 = i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo3 = round(ranuni(1)*10);&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo4 = round(ranuni(100), 0.01);&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo5 = date();&lt;/P&gt;&lt;P&gt;&amp;nbsp; format campo5 yymmddn8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This is the filter I am doing, usin data/set or a proc sql. I need that this filter goes very quick */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data prueba1;&lt;/P&gt;&lt;P&gt;set prueba;&lt;/P&gt;&lt;P&gt;where campo3 = 5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table prueba1 as&lt;/P&gt;&lt;P&gt;(select * from prueba&lt;/P&gt;&lt;P&gt;where campo3 = 5);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 10:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214710#M39630</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2015-06-26T10:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214711#M39631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kurt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above the code I am using trying to learn how to use indexes.&lt;/P&gt;&lt;P&gt;I don' want to do sorts because my input datasets is large.&lt;/P&gt;&lt;P&gt;How can I see and manage 'pages'?, I don't know how to....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This is my dataset */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data prueba(drop = i);&lt;/P&gt;&lt;P&gt;do i = 1 to 50000000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo1='abc';&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo2 = i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo3 = round(ranuni(1)*10);&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo4 = round(ranuni(100), 0.01);&lt;/P&gt;&lt;P&gt;&amp;nbsp; campo5 = date();&lt;/P&gt;&lt;P&gt;&amp;nbsp; format campo5 yymmddn8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This is the filter I am doing, usin data/set or a proc sql. I need that this filter goes very quick */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data prueba1;&lt;/P&gt;&lt;P&gt;set prueba;&lt;/P&gt;&lt;P&gt;where campo3 = 5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table prueba1 as&lt;/P&gt;&lt;P&gt;(select * from prueba&lt;/P&gt;&lt;P&gt;where campo3 = 5);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 10:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214711#M39631</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2015-06-26T10:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214712#M39632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See, a SAS dataset is organized in "pages" that hold several records(observations); the number of observations per page can be determined with proc contents and depends on the observation size. The page size is dependent on operating system and file system parameters, and the observation size.&lt;/P&gt;&lt;P&gt;To get a specific observation, SAS always needs to read the whole page physically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example, you create a number between 0 and 10 (where 1 to 9 will each occur in 10%, and 0 and 10 in 5% of the observations).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that each page holds, say, 100 observations, the probability that each discrete value of campo3 is present in ALL pages is, for all purposes, 1. Which means that SAS will have to physically read all pages of the dataset anyway, so it is best to not use an index, but read the dataset sequentially.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just created a sample of your dataset an my server (SAS 9.2, AIX - 64 bit), with 10000 obs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset page size: 8192&lt;/P&gt;&lt;P&gt;observation size: 40&lt;/P&gt;&lt;P&gt;max obs per page: 203&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you see, you WILL have all values of campo3 present in all pages.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 11:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214712#M39632</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-06-26T11:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214713#M39633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kurt&lt;/P&gt;&lt;P&gt;Its really helpful,&lt;/P&gt;&lt;P&gt;Can you please give an example in which the creation and use of indexes take advantage??&lt;/P&gt;&lt;P&gt;Thsnks un avance,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 11:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214713#M39633</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2015-06-26T11:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214714#M39634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are literary tons of papers on the issue. And if you wish to look at some more official, see the index section in the SAS Language Concepts at support.sas.com.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 11:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214714#M39634</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-06-26T11:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214715#M39635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically, everytime the index can be used to extract a small fraction of the whole dataset, with a high probabilty that I/O can be reduced. ie one single date out of one or more years.&lt;/P&gt;&lt;P&gt;Or to find/update single observations, although this will rarely happen in SAS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 12:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214715#M39635</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-06-26T12:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214716#M39636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;Hi Kurt,&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;I give you an example with a composite index that it's noy using the index in the data setp and I don't undetstannd why..&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;Thanks in advance.&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;----&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;%let fecha_ini = %sysevalf(%sysfunc(date()) - 900);&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;%let fecha2 = %sysfunc(date());&lt;BR /&gt;%let fecha1 = %sysevalf(%sysfunc(date()) - 10);&lt;BR /&gt;%let producto1 = P100;&lt;BR /&gt;%let producto2 = P1000;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;%put fecha_ini = &amp;amp;fecha_ini;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;data ventas(drop=i);&lt;BR /&gt;do i=1 to 10000000;&lt;BR /&gt;fecha = &amp;amp;fecha_ini + round(900*ranuni(1));&lt;BR /&gt;cod_producto = compress('P'||round(ranuni(1)*10000));&lt;BR /&gt;hc_importe = round(ranuni(1)*1000);&lt;BR /&gt;format fecha ddmmyyn8.;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;options msglevel=i;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;proc contents data=ventas;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;run;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;/* index */&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;proc sql;&lt;BR /&gt;create index i_ventas on ventas (fecha, cod_producto);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;data salida; &lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;set ventas;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px;"&gt;where fecha = &amp;amp;fecha1 and cod_producto = "&amp;amp;producto1";&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2015 14:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214716#M39636</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2015-06-28T14:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using indexes in SAS data steps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214717#M39637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A log would help to prove your case... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp; data salida;&lt;/P&gt;&lt;P&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set ventas;&lt;/P&gt;&lt;P&gt;32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where fecha = &amp;amp;fecha1 and cod_producto = "&amp;amp;producto1";&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INFO: Index i_ventas selected for WHERE clause optimization.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;33&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2015 19:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-using-indexes-in-SAS-data-steps/m-p/214717#M39637</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-06-28T19:01:59Z</dc:date>
    </item>
  </channel>
</rss>

