<?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: I Need clarification on Hash Object in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141108#M28381</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;be sure to use the colon(:) in the Multidata option: &lt;STRONG&gt;Multidata:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Maybe double quotes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at the documentation: &lt;A href="http://support.sas.com/documentation/cdl/en/lecompobjref/63327/HTML/default/viewer.htm#p00ilfw5pzcjvtn1nfya9863fozd.htm" title="http://support.sas.com/documentation/cdl/en/lecompobjref/63327/HTML/default/viewer.htm#p00ilfw5pzcjvtn1nfya9863fozd.htm"&gt;SAS(R) 9.3 Component Objects: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jan 2014 21:15:20 GMT</pubDate>
    <dc:creator>CTorres</dc:creator>
    <dc:date>2014-01-14T21:15:20Z</dc:date>
    <item>
      <title>I Need clarification on Hash Object</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141105#M28378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am learning hash objects ,when I was working on the below scenario,it is giving as specified below.please clarify.&lt;/P&gt;&lt;P&gt;I have two data sets ,I am assuming that one is bigger one and one is smaller one.&lt;/P&gt;&lt;P&gt;the smaller data(data1) set consists of following data.&lt;/P&gt;&lt;P&gt;connection_id credit_teamid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the bigger one(master) data set consists of following data.&lt;/P&gt;&lt;P&gt;Connection_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; credit_teamid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit_desc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group_code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Hash_sample(drop=search);&lt;/P&gt;&lt;P&gt;length&amp;nbsp; connection_id 10;&lt;/P&gt;&lt;P&gt;length&amp;nbsp; credit_team_id unit_desc group_code $20;&lt;/P&gt;&lt;P&gt;if _n_=1 then do;&lt;/P&gt;&lt;P&gt;declare hash first_HT(dataset:"master");&lt;/P&gt;&lt;P&gt;first_ht.definekey("connection_id","credit_team_id");&lt;/P&gt;&lt;P&gt;first_ht.definedata("unit_desc","group_code");&lt;/P&gt;&lt;P&gt;first_ht.definedone();&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;set data1;&lt;/P&gt;&lt;P&gt;search=first_ht.find();&lt;/P&gt;&lt;P&gt;if search=0 then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I'm getting the output like this&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though master data set consists of same connection id and credit team id's more than once,small data set is not merging with all the connection and credit team id's in the master data set.&lt;/P&gt;&lt;P&gt;It is only merging with first occurance(first.) of the connection id and credit team id's of the master data set.&lt;/P&gt;&lt;P&gt;Please clarify.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 18:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141105#M28378</guid>
      <dc:creator>sahaji</dc:creator>
      <dc:date>2014-01-14T18:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: I Need clarification on Hash Object</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141106#M28379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using the&lt;STRONG&gt; Multidata: 'Y' option&lt;/STRONG&gt; in the Declare Hash statement:&amp;nbsp; declare hash first_HT(dataset:"master", Multidata: 'Y');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 19:51:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141106#M28379</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-01-14T19:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: I Need clarification on Hash Object</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141107#M28380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi CTorres,&lt;/P&gt;&lt;P&gt;I tried with the multidata,It is giving the error message :unknown argument Multidata.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 20:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141107#M28380</guid>
      <dc:creator>sahaji</dc:creator>
      <dc:date>2014-01-14T20:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: I Need clarification on Hash Object</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141108#M28381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;be sure to use the colon(:) in the Multidata option: &lt;STRONG&gt;Multidata:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Maybe double quotes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at the documentation: &lt;A href="http://support.sas.com/documentation/cdl/en/lecompobjref/63327/HTML/default/viewer.htm#p00ilfw5pzcjvtn1nfya9863fozd.htm" title="http://support.sas.com/documentation/cdl/en/lecompobjref/63327/HTML/default/viewer.htm#p00ilfw5pzcjvtn1nfya9863fozd.htm"&gt;SAS(R) 9.3 Component Objects: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 21:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141108#M28381</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-01-14T21:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: I Need clarification on Hash Object</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141109#M28382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For loading "master" into a hash you would need "multidata" with the keys you've chosen. You then would also need to iterate through the groups with the same key as shown here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lecompobjref/63327/HTML/default/viewer.htm#p08g14jub9cm21n19uekhrferfrr.htm" title="http://support.sas.com/documentation/cdl/en/lecompobjref/63327/HTML/default/viewer.htm#p08g14jub9cm21n19uekhrferfrr.htm"&gt;SAS(R) 9.3 Component Objects: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But actually for what I believe you're trying to achieve it would be much better to load the small data set into a hash. As the key variables exist in both "master" and "data1" you don't need to define the variables for the hash if "setting" master before the hash definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code as below should do (not tested):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Hash_sample (drop=_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set master;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_=1 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; declare hash first_HT(dataset:"data1");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=first_ht.definekey("connection_id","credit_team_id");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _rc=first_ht.definedone();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first_ht.find()=0 then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jan 2014 01:41:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-Need-clarification-on-Hash-Object/m-p/141109#M28382</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-01-15T01:41:31Z</dc:date>
    </item>
  </channel>
</rss>

