<?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 Hash help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hash-help/m-p/52453#M11079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Ksharp. That is what I ended up doing. I was trying to figure out if it could all be done in one data step. I am still trying to understand hash coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Nov 2011 15:20:59 GMT</pubDate>
    <dc:creator>LindaG</dc:creator>
    <dc:date>2011-11-23T15:20:59Z</dc:date>
    <item>
      <title>Hash help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-help/m-p/52451#M11077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am really new to using hash objects. I can do the basics, but I was wondering if someone can lend me a little help. The short version is that I want to compare the key (ID) with two different variables in the hash object (ID and parentID). If ID matches ID in the hash object, I want the program to pull some data into the main data set. I know how to do this portion. However, I also want to compare ID to the variable parentID in the hash object, and if they match, then I want to put a "yes" in a different variable (parent) in the main data set. Is it possible to do this, to compare the key to two different variables in the hash? The code I have so far is below, and it does the first portion of what I want of pulling in information if the key matches.&amp;nbsp; ﻿&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data TCE.infoflag; &lt;/P&gt;&lt;P&gt;length ParentID $13; &lt;/P&gt;&lt;P&gt;length ParentName $80;&lt;/P&gt;&lt;P&gt;length ParentNPLStatus $30; &lt;/P&gt;&lt;P&gt;set TCE.infoflag; &lt;/P&gt;&lt;P&gt;if _n_= 1 then do; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; declare hash hh(dataset: 'NPL.parent'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hh.definekey('ID'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hh.definedata('ParentID', 'ParentName', 'ParentNPLStatus'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hh.definedone(); &lt;/P&gt;&lt;P&gt;end; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if hh.find() ge 0; &lt;/P&gt;&lt;P&gt;run;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 14:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-help/m-p/52451#M11077</guid>
      <dc:creator>LindaG</dc:creator>
      <dc:date>2011-11-22T14:22:40Z</dc:date>
    </item>
    <item>
      <title>Hash help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-help/m-p/52452#M11078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Welcome to Hash World!. &lt;/P&gt;&lt;P&gt;I bet you will like it more and more.&lt;/P&gt;&lt;P&gt;About your question, I think answer is yes. &lt;/P&gt;&lt;P&gt;You need build another Hash Table to hold parentID as a key, then use check() method to see whether they are matched.&lt;/P&gt;&lt;P&gt;If matched then parent='yes';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to get answer is to post some sample data and output you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 03:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-help/m-p/52452#M11078</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-11-23T03:34:10Z</dc:date>
    </item>
    <item>
      <title>Hash help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-help/m-p/52453#M11079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Ksharp. That is what I ended up doing. I was trying to figure out if it could all be done in one data step. I am still trying to understand hash coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 15:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-help/m-p/52453#M11079</guid>
      <dc:creator>LindaG</dc:creator>
      <dc:date>2011-11-23T15:20:59Z</dc:date>
    </item>
  </channel>
</rss>

