<?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: HASH update all records in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819544#M323506</link>
    <description>&lt;P&gt;Whar do you mean by update? And to what values?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2022 07:46:28 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-06-22T07:46:28Z</dc:date>
    <item>
      <title>HASH update all records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819543#M323505</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;How can i update all columns in a table into hash join?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data master_table;
	set  master_table;
	if _n_ = 1 then
		do;
			declare hash a (dataset:"update_table");
			a.definekey('ID1','ID2');
			a.definedone();
		end;
	if a.check() = 0 then
		do;
			/*??*/
		end;	
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 07:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819543#M323505</guid>
      <dc:creator>ger15xxhcker</dc:creator>
      <dc:date>2022-06-22T07:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: HASH update all records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819544#M323506</link>
      <description>&lt;P&gt;Whar do you mean by update? And to what values?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 07:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819544#M323506</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-06-22T07:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: HASH update all records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819547#M323507</link>
      <description>&lt;P&gt;Where the 'update_table' table matches the 'master_table' key by key, overwrites all (non-key) fields with the field values ​​in 'update_table'. (Both tables have the same fields.). Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 07:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819547#M323507</guid>
      <dc:creator>ger15xxhcker</dc:creator>
      <dc:date>2022-06-22T07:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: HASH update all records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819549#M323508</link>
      <description>&lt;P&gt;I can't see your data, so this code is untested. But I think this is what you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data master_table;
   
   if _n_ = 1 then do;
      declare hash a (dataset:"update_table");
      a.definekey('ID1','ID2');
	  a.definedata(all : 'Y')
      a.definedone();
   end;
   
   set  master_table;
   
   if 0 then set update_table;
   
   rc = a.find(); 
   
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2022 08:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819549#M323508</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-06-22T08:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: HASH update all records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819566#M323516</link>
      <description>&lt;P&gt;Also, if both tables contain exactly the same variables, then the if 0 .. statement is obsolete.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 10:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819566#M323516</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-06-22T10:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: HASH update all records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819604#M323526</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 12:56:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HASH-update-all-records/m-p/819604#M323526</guid>
      <dc:creator>ger15xxhcker</dc:creator>
      <dc:date>2022-06-22T12:56:35Z</dc:date>
    </item>
  </channel>
</rss>

