<?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: FCMP Function with HASH joins in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454158#M29272</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Here is the log from the datastep. Initially the lookup was a 14million x 8 table. For this I was testing with a 500 x 2 table." style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19807iEFD8D6BF8E63650F/image-size/large?v=v2&amp;amp;px=999" role="button" title="datastepLog.PNG" alt="Here is the log from the datastep. Initially the lookup was a 14million x 8 table. For this I was testing with a 500 x 2 table." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Here is the log from the datastep. Initially the lookup was a 14million x 8 table. For this I was testing with a 500 x 2 table.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 14 Apr 2018 16:26:01 GMT</pubDate>
    <dc:creator>sturg1dj</dc:creator>
    <dc:date>2018-04-14T16:26:01Z</dc:date>
    <item>
      <title>FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454089#M29270</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I am trying to build lookup functions within a medicare database to easily get things like birthdate, deathdate, race and so on. The error I get when I run it is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unable to define key/date '&lt;STRIKE&gt;BENE_RACE_CD&lt;/STRIKE&gt;' 'BENE_BIRTH_DT' 'for HASH object 'lookup'. Not found in dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error reported in funtion 'DEFINEDATA_HASH_' in statement number 4 at line 9 column 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;these errors are especially annoying because the first time I ran it they worked. Then they did stopped working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FCMP.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19798i42B49CE8CBAE4605/image-size/large?v=v2&amp;amp;px=999" role="button" title="FCMP.PNG" alt="FCMP.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;keep is in the dataset portion because if I don't use it I run out of memory (and the server I use is not very flexible when it comes to setting memory).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached an image of my code since the server I am on does not let me copy things easily off of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;edit: I put the wrong variable in the error, but I posted the actual error below.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 16:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454089#M29270</guid>
      <dc:creator>sturg1dj</dc:creator>
      <dc:date>2018-04-14T16:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454105#M29271</link>
      <description>&lt;P&gt;The variable you refer to BENE_RACE_CD doesn't appear in the code you posted. It would be helpful not only to post the correct FCMP function code but also the DATA step log in which you are using it including error messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How big is your lookup tables? Remember hash tables have to be loaded into memory so unless you can guarantee you are always going to have enough memory, then using HASH table techniques could be problematic.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 02:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454105#M29271</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-04-14T02:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454158#M29272</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Here is the log from the datastep. Initially the lookup was a 14million x 8 table. For this I was testing with a 500 x 2 table." style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19807iEFD8D6BF8E63650F/image-size/large?v=v2&amp;amp;px=999" role="button" title="datastepLog.PNG" alt="Here is the log from the datastep. Initially the lookup was a 14million x 8 table. For this I was testing with a 500 x 2 table." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Here is the log from the datastep. Initially the lookup was a 14million x 8 table. For this I was testing with a 500 x 2 table.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 16:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454158#M29272</guid>
      <dc:creator>sturg1dj</dc:creator>
      <dc:date>2018-04-14T16:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454216#M29288</link>
      <description>&lt;P&gt;Wouldn't BENE_BIRTH_DT need to be in your KEEP = variables? Also 14M rows is getting pretty big for a hash table, depending on how much memory you have available. What is your SAS MEMSIZE option setting?&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 23:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454216#M29288</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-04-14T23:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454249#M29290</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49441"&gt;@sturg1dj&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Besides of everything else&amp;nbsp;I believe your code would recreate and reload a hash table for every single call of the function. That's certainly something you don't want to do.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 05:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454249#M29290</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-04-15T05:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454284#M29292</link>
      <description>&lt;P&gt;Yes, you are correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are 4 nearly identical functions that I wrote and I keep mixing them up when posting. Basically the keep has two variables, the first is the key which is bene_id, the second is one of the following: bene_death_dt, bene_birth_dt, bene_race_cd, or bene_sex_cd. I double-checked the code to make sure everything is consistent in each function and it is.&amp;nbsp;&amp;nbsp;The error is consistent regardless of which function I use (telling me the second variable I keep is not present).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is also annoying is if I create a new set that does the keep first that is accessed by the function without a keep then it works (at least with the test set of 500).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is becoming quite apparent is that this seems like a case of me using the wrong tool for the job. Hash is probably not the answer, but it still is bugging me that the keep does not seem to be working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 19:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454284#M29292</guid>
      <dc:creator>sturg1dj</dc:creator>
      <dc:date>2018-04-15T19:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454293#M29293</link>
      <description>&lt;P&gt;Hash works best with highly predictable data and static keys. I agree you are probably using the wrong tool here.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 20:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454293#M29293</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-04-15T20:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: FCMP Function with HASH joins</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454300#M29294</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49441"&gt;@sturg1dj&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You'd probably better off implementing this via a SAS Macro where you pass in source variables (what you use in your hash table) and target variable as parameters.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 21:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/FCMP-Function-with-HASH-joins/m-p/454300#M29294</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-04-15T21:35:50Z</dc:date>
    </item>
  </channel>
</rss>

