<?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: Define key and define data in hashing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Define-key-and-define-data-in-hashing/m-p/238501#M43821</link>
    <description>&lt;P&gt;I am going through some training myself so there are most likely better sources but I will explain something as I understand it to join the conversation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;merge emphours (in=a)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees(in=b);&lt;BR /&gt;by empid;&lt;BR /&gt;if a;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data empinfo;&lt;BR /&gt;length empid $6. empln $30. empfn $25. empmi $1. gender $1. startdate 8. emppaylevel $5.;&lt;BR /&gt;if _N_ = 1 then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;declare hash new(dataset: 'employees',ordered: 'y');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new.definekey('empid');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new.definedata('empln','empfn','empmi','gender','startdate','emppaylevel');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new.definedone();&lt;BR /&gt;call missing(empln,empfn,empmi,gender,startdate,emppaylevel);&lt;BR /&gt;end;&lt;BR /&gt;set emphours;&lt;BR /&gt;rc = new.find();&lt;BR /&gt;drop rc;&lt;BR /&gt;format startdate mmddyy10.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The two pieces of code produce the same results, definekey is the key in the hash table that I am generating and the field that I will be joining on.&amp;nbsp; definedata() is the fields that I want to pull in.&amp;nbsp; This is a simple merge, I am pulling fields from the employee dataset, joining to the emphours dataset.&amp;nbsp; This is a very simple example for hash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope I provided some help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2015 13:47:48 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2015-12-09T13:47:48Z</dc:date>
    <item>
      <title>Define key and define data in hashing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-key-and-define-data-in-hashing/m-p/238484#M43818</link>
      <description>&lt;P&gt;I've trouble understanding the defining keys and data&amp;nbsp;in hashing. I read the document under&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#n1b4cbtmb049xtn1vh9x4waiioz4.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#n1b4cbtmb049xtn1vh9x4waiioz4.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still I couldn't understand. May I request someone to explain about&amp;nbsp;&lt;SPAN&gt;defin&lt;/SPAN&gt;&lt;SPAN&gt;ing keys and data&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;in hashing in simple terms?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance for any help you offer me.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 10:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-key-and-define-data-in-hashing/m-p/238484#M43818</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-12-09T10:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Define key and define data in hashing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-key-and-define-data-in-hashing/m-p/238493#M43820</link>
      <description>Here's a good reference paper, &lt;A href="http://support.sas.com/resources/papers/proceedings10/151-2010.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings10/151-2010.pdf&lt;/A&gt;</description>
      <pubDate>Wed, 09 Dec 2015 12:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-key-and-define-data-in-hashing/m-p/238493#M43820</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-09T12:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Define key and define data in hashing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Define-key-and-define-data-in-hashing/m-p/238501#M43821</link>
      <description>&lt;P&gt;I am going through some training myself so there are most likely better sources but I will explain something as I understand it to join the conversation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;merge emphours (in=a)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees(in=b);&lt;BR /&gt;by empid;&lt;BR /&gt;if a;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data empinfo;&lt;BR /&gt;length empid $6. empln $30. empfn $25. empmi $1. gender $1. startdate 8. emppaylevel $5.;&lt;BR /&gt;if _N_ = 1 then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;declare hash new(dataset: 'employees',ordered: 'y');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new.definekey('empid');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new.definedata('empln','empfn','empmi','gender','startdate','emppaylevel');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new.definedone();&lt;BR /&gt;call missing(empln,empfn,empmi,gender,startdate,emppaylevel);&lt;BR /&gt;end;&lt;BR /&gt;set emphours;&lt;BR /&gt;rc = new.find();&lt;BR /&gt;drop rc;&lt;BR /&gt;format startdate mmddyy10.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The two pieces of code produce the same results, definekey is the key in the hash table that I am generating and the field that I will be joining on.&amp;nbsp; definedata() is the fields that I want to pull in.&amp;nbsp; This is a simple merge, I am pulling fields from the employee dataset, joining to the emphours dataset.&amp;nbsp; This is a very simple example for hash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope I provided some help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 13:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Define-key-and-define-data-in-hashing/m-p/238501#M43821</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-12-09T13:47:48Z</dc:date>
    </item>
  </channel>
</rss>

