<?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: Index key lookup in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Index-key-lookup/m-p/179033#M34211</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you add a variable to NODUPS you will see a difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Dec 2013 12:45:38 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2013-12-20T12:45:38Z</dc:date>
    <item>
      <title>Index key lookup</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-key-lookup/m-p/179032#M34210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see &lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm"&gt;SAS(R) 9.3 Statements: Reference&lt;/A&gt;, examples #7 and #8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups (index=(x / nomiss));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; x=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=x*&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; z=x**&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups (index=(x));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; x=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;10&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups key=x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups key=x / unique;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups key=x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; foo=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;+y;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups key=x / unique;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; foo=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;+y;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I quote Example 8:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;This example uses the KEY= option to perform a table lookup. The DATA step reads a primary data set that is named INVTORY, which is indexed on PARTNO, and a lookup data set named PARTCODE. PARTCODE contains quantities of new stock (variable NEW_STK). The UNIQUE option ensures that, &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;if there are any duplicate observations in INVTORY, values of NEW_STK are added only to the first observation of the group.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I'm probably just misunderstanding the documentation, but shouldn't I expect different results for final3 and final4?&amp;nbsp; If these results are as you expect, can you further explain the underlined bit above?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Scott&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 06:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-key-lookup/m-p/179032#M34210</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-12-20T06:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Index key lookup</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-key-lookup/m-p/179033#M34211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you add a variable to NODUPS you will see a difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 12:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-key-lookup/m-p/179033#M34211</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-12-20T12:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Index key lookup</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-key-lookup/m-p/179034#M34212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed my test code as below and now see the difference.&amp;nbsp; From reading the example in the doc, I would have expected to see the difference in Final3 and Final4, not Final1 and Final2.&amp;nbsp; Am I just mis-reading the doc, or is the example wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was pleased to see that repeated calls to &lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: fuchsia; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'SAS Monospace'; color: black; background-color: white;"&gt; dups key=x &lt;/SPAN&gt;retrieved the next record matching the key, rather than continually retrieving the first record.&amp;nbsp; This, coupled with _iorc_, would allow building a Cartesian product if you know or expect the lookup dataset to have non-unique keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With my "real" data, I've got a small transaction dataset, but millions of records in SCD2 dimension tables.&amp;nbsp; I also need this lookup to be &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;fast&lt;/STRONG&gt;&lt;/SPAN&gt;, as it's for an online (stored process) application.&amp;nbsp; This approach was blindingly quick - much faster than hash object join or SQL (even with indexes).&amp;nbsp; Like 0.5 seconds vs. 45 seconds using hash objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been programming SAS a while, and this technique has been in the doc even longer - too bad I never connected the dots until now &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&amp;nbsp; As you say in your profile, I'm (still) learning SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this approach will be very useful for our ETL/Data Warehouse processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again Data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups (index=(x / nomiss));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; x=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=x*&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; z+&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; z+&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; z+&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups (index=(x));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; x=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;10&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a=x**&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;4&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; i=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;4&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups key=x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; rc=_iorc_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; i=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;4&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups key=x / unique;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; rc=_iorc_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups key=x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; foo=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;+y;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; bar=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;+a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; final4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; dups;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; nodups key=x / unique;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; foo=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;+y;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp; bar=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;+a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Dec 2013 00:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-key-lookup/m-p/179034#M34212</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-12-21T00:56:07Z</dc:date>
    </item>
  </channel>
</rss>

