<?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 Table adds all values in table in stead of only the defined ones in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Hash-Table-adds-all-values-in-table-in-stead-of-only-the-defined/m-p/18803#M3736</link>
    <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've been checking up on hash tables and what they could do for me, but even this basic test doesn't work out as expected:&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;data Hash_TEST;&lt;/B&gt;&lt;BR /&gt;
                set TEST_POPULATION point = _n_;&lt;BR /&gt;
&lt;BR /&gt;
	declare hash hh (dataset: 'work.TESTPOPULATIE', hashexp: 10);&lt;BR /&gt;
	&lt;BR /&gt;
	hh.DefineKey ('KEYFIELD');&lt;BR /&gt;
	hh.DefineData ('KEYFIELD', 'SECONDFIELD');&lt;BR /&gt;
	hh.DefineDone ();&lt;BR /&gt;
&lt;BR /&gt;
	do until (eof1);&lt;BR /&gt;
		set COMPTABLE end = eof1;&lt;BR /&gt;
		if hh.find() = 0 then output;&lt;BR /&gt;
	end;&lt;BR /&gt;
	stop;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;run;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
This code results in the matching records, but in stead of only reporting the fields mentioned in "DefineData" I get all of the fields in the TEST_POPULATION table.&lt;BR /&gt;
&lt;BR /&gt;
What could be a logical explanation for this?&lt;BR /&gt;
(Could be something very basic, as I only recently found out about these)</description>
    <pubDate>Tue, 01 Mar 2011 10:18:12 GMT</pubDate>
    <dc:creator>RFLinnenbank</dc:creator>
    <dc:date>2011-03-01T10:18:12Z</dc:date>
    <item>
      <title>Hash Table adds all values in table in stead of only the defined ones</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Hash-Table-adds-all-values-in-table-in-stead-of-only-the-defined/m-p/18803#M3736</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've been checking up on hash tables and what they could do for me, but even this basic test doesn't work out as expected:&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;data Hash_TEST;&lt;/B&gt;&lt;BR /&gt;
                set TEST_POPULATION point = _n_;&lt;BR /&gt;
&lt;BR /&gt;
	declare hash hh (dataset: 'work.TESTPOPULATIE', hashexp: 10);&lt;BR /&gt;
	&lt;BR /&gt;
	hh.DefineKey ('KEYFIELD');&lt;BR /&gt;
	hh.DefineData ('KEYFIELD', 'SECONDFIELD');&lt;BR /&gt;
	hh.DefineDone ();&lt;BR /&gt;
&lt;BR /&gt;
	do until (eof1);&lt;BR /&gt;
		set COMPTABLE end = eof1;&lt;BR /&gt;
		if hh.find() = 0 then output;&lt;BR /&gt;
	end;&lt;BR /&gt;
	stop;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;run;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
This code results in the matching records, but in stead of only reporting the fields mentioned in "DefineData" I get all of the fields in the TEST_POPULATION table.&lt;BR /&gt;
&lt;BR /&gt;
What could be a logical explanation for this?&lt;BR /&gt;
(Could be something very basic, as I only recently found out about these)</description>
      <pubDate>Tue, 01 Mar 2011 10:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Hash-Table-adds-all-values-in-table-in-stead-of-only-the-defined/m-p/18803#M3736</guid>
      <dc:creator>RFLinnenbank</dc:creator>
      <dc:date>2011-03-01T10:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Hash Table adds all values in table in stead of only the defined ones</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Hash-Table-adds-all-values-in-table-in-stead-of-only-the-defined/m-p/18804#M3737</link>
      <description>Hi.&lt;BR /&gt;
You need change ' set TEST_POPULATION point = _n_;' into&lt;BR /&gt;
[pre]&lt;BR /&gt;
 if _n_ = 0 then set work.TESTPOPULATIE';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
to let SAS know what type variable in the hash table.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 02 Mar 2011 05:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Hash-Table-adds-all-values-in-table-in-stead-of-only-the-defined/m-p/18804#M3737</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-03-02T05:39:34Z</dc:date>
    </item>
  </channel>
</rss>

