<?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 Object Code Question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hash-Object-Code-Question/m-p/348839#M273495</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would someone please explain how the missing records section work? Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;declare hash hct(dataset: 'work.etls_compare_digest', hashexp: 10);&lt;BR /&gt;hct.defineKey("sourcedb_id", "case_id");&lt;BR /&gt;hct.defineData("sourcedb_id", "case_id", "compare_digest");&lt;BR /&gt;hct.defineDone();&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;set work.W1PAEO8L end = eof;&lt;BR /&gt;&lt;BR /&gt;/* create digest - version 2.1 */&lt;BR /&gt;source_digest = put(md5(catq(' ', contact_id, subject_id, owner_id, owner_name, case_name, Season,&lt;BR /&gt;case_priority, case_notes, case_state_code, case_status_code,&lt;BR /&gt;case_status_desc)), $hex32.);&lt;BR /&gt;&lt;BR /&gt;/* source/compare match */&lt;BR /&gt;if hct.find() eq 0 then&lt;BR /&gt;do;&lt;BR /&gt;/* source/compare match: Unchanged records */&lt;BR /&gt;if source_digest eq compare_digest then&lt;BR /&gt;output work.WGK73ZRO;&lt;BR /&gt;&lt;BR /&gt;/* source/compare match: Changed records */&lt;BR /&gt;else if source_digest ne compare_digest then&lt;BR /&gt;output work.WGK73X4D;&lt;BR /&gt;&lt;BR /&gt;/* remove found key + data */&lt;BR /&gt;hct.remove();&lt;BR /&gt;end;&lt;BR /&gt;/* source table: New records */&lt;BR /&gt;else if hct.find() ne 0 then&lt;BR /&gt;output work.WGK73YG2;&lt;BR /&gt;&lt;BR /&gt;/* Missing records */&lt;BR /&gt;if eof then&lt;BR /&gt;rc = hct.output(dataset: 'work.WGK7411D(drop = compare_digest)');&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 19:10:39 GMT</pubDate>
    <dc:creator>Mixer</dc:creator>
    <dc:date>2017-04-10T19:10:39Z</dc:date>
    <item>
      <title>Hash Object Code Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-Object-Code-Question/m-p/348839#M273495</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would someone please explain how the missing records section work? Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;declare hash hct(dataset: 'work.etls_compare_digest', hashexp: 10);&lt;BR /&gt;hct.defineKey("sourcedb_id", "case_id");&lt;BR /&gt;hct.defineData("sourcedb_id", "case_id", "compare_digest");&lt;BR /&gt;hct.defineDone();&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;set work.W1PAEO8L end = eof;&lt;BR /&gt;&lt;BR /&gt;/* create digest - version 2.1 */&lt;BR /&gt;source_digest = put(md5(catq(' ', contact_id, subject_id, owner_id, owner_name, case_name, Season,&lt;BR /&gt;case_priority, case_notes, case_state_code, case_status_code,&lt;BR /&gt;case_status_desc)), $hex32.);&lt;BR /&gt;&lt;BR /&gt;/* source/compare match */&lt;BR /&gt;if hct.find() eq 0 then&lt;BR /&gt;do;&lt;BR /&gt;/* source/compare match: Unchanged records */&lt;BR /&gt;if source_digest eq compare_digest then&lt;BR /&gt;output work.WGK73ZRO;&lt;BR /&gt;&lt;BR /&gt;/* source/compare match: Changed records */&lt;BR /&gt;else if source_digest ne compare_digest then&lt;BR /&gt;output work.WGK73X4D;&lt;BR /&gt;&lt;BR /&gt;/* remove found key + data */&lt;BR /&gt;hct.remove();&lt;BR /&gt;end;&lt;BR /&gt;/* source table: New records */&lt;BR /&gt;else if hct.find() ne 0 then&lt;BR /&gt;output work.WGK73YG2;&lt;BR /&gt;&lt;BR /&gt;/* Missing records */&lt;BR /&gt;if eof then&lt;BR /&gt;rc = hct.output(dataset: 'work.WGK7411D(drop = compare_digest)');&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-Object-Code-Question/m-p/348839#M273495</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2017-04-10T19:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Object Code Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hash-Object-Code-Question/m-p/348887#M273496</link>
      <description>&lt;P&gt;You told SAS to set a flag when your were reading the last observation in your SET statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;set work.W1PAEO8L end = eof;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then when you get to the last observation you write out the remain records from the hash object. You ave added dataset options to drop one of the variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if eof then
  rc = hct.output(dataset: 'work.WGK7411D(drop = compare_digest)')
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:47:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hash-Object-Code-Question/m-p/348887#M273496</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-04-10T20:47:46Z</dc:date>
    </item>
  </channel>
</rss>

