<?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: Advantage and disadvantage of hash table? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212576#M39289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not a single I/O operation, it is a SINGLE SEQUENTIAL READ OPERATION through the file. Each record is read exactly once from storage while placing it into the hash, instead of reading it repeatedly with other methods.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Apr 2015 08:06:57 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2015-04-02T08:06:57Z</dc:date>
    <item>
      <title>Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212554#M39267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts:&lt;/P&gt;&lt;P&gt;I have few questions want to ask about hash table.&lt;/P&gt;&lt;P&gt;1.When use hash table to look up matched records, do records in hash table scanned sequentially from top to bottom or it will jump to the corresponding key value straight just like index?&lt;/P&gt;&lt;P&gt;2.What is the advantage and disadvantage of hash table compare to proc sql and data step merge?&lt;/P&gt;&lt;P&gt;3.To be updated in the future...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 06:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212554#M39267</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-03-30T06:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212555#M39268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. You can work through a hash object sequentially and with keys.&lt;/P&gt;&lt;P&gt;2. The advantage of a hash object is that you can avoid lots of I/O on one of the input tables (if you don't do a straight merge); the disadvantage is that you will be limited by the available memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 06:33:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212555#M39268</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-03-30T06:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212556#M39269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; it will jump to the corresponding key value straight just like index.&amp;nbsp; In Hash Map(in Java,&amp;nbsp; old catchphrase is Hash Table), it is called bucket which can decide the speed of querying . more buckets more fast . You could define it when constructing a Hash Map like : declare hash h(hashexp:20);&amp;nbsp;&amp;nbsp; 20 is the maximize value of buckets - 2^20&amp;nbsp; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Hash Map is a querying tool by&amp;nbsp; using space(memory) to exchange&amp;nbsp; time . therefore disadvantage is memory limitation. and hard to handle the continuous value (double value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 12:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212556#M39269</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-30T12:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212557#M39270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot !!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 22:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212557#M39270</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-03-30T22:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212558#M39271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi KurtBremser,&lt;/P&gt;&lt;P&gt;I was bit confused why Hash can improve I/O process?&lt;/P&gt;&lt;P&gt;assume you have two tables want to merge each table contain 50k records. Table A and Table B and input buffer can only take 10k records each time.&lt;/P&gt;&lt;P&gt;if you use data step merge then 50k+50k records will be loaded to input buffer 10 times ((50k+50k)/10k=10 times)&lt;/P&gt;&lt;P&gt;50k+50k on hard disk----&amp;gt;Input buffer-----&amp;gt;PDV----&amp;gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use hash to hold table A, then it takes 5 times(50k/10k=5times) for data records on table A to load to input buffer then to HASH table. it will also take 5 times (50k/10k=5times) for data records in table B to be loaded to input buffer. so the total is 5+5=10 times. there is no difference....&lt;/P&gt;&lt;P&gt;50k records in table A on hard disk----&amp;gt;input buffer----&amp;gt;PDV-----&amp;gt;HASH&lt;/P&gt;&lt;P&gt;50k records in table B on hard disk-----&amp;gt; input buffer-----PDV---&amp;gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please explain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 03:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212558#M39271</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-04-01T03:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212559#M39272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Imagine a situation where you have to match several records of dataset B to a record of dataset A, on a complex condition that can't be solved by simply sorting through the datasets an merging them along the sort.&lt;/P&gt;&lt;P&gt;Think of the fuzzy logic needed to match actual inputs of your users to the normalized names of, say, car types.&lt;/P&gt;&lt;P&gt;In that case you will have to read more or less randomly through dataset B for every record of dataset A.&lt;/P&gt;&lt;P&gt;If you loaded dataset B into a hash object at _n_ = 1, you have the complete I/O from dataset B only once, and sequentially at that.&lt;/P&gt;&lt;P&gt;Another use that I encounterd quite often is when you have to determine the actual work hours spent for a service call between initial call and problem solved (Saturday and Sunday don't count, Monday to Thursday 7am to 5pm, Friday 7am to 3pm, holidays also don't count).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 06:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212559#M39272</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-01T06:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212560#M39273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah another duplicate question. not really duplicated&amp;nbsp; (2/ ) but having the same root cause.&lt;A _jive_internal="true" href="https://communities.sas.com/thread/74705"&gt;https://communities.sas.com/thread/74705&lt;/A&gt; as of optimizing memory dim&lt;A _jive_internal="true" href="https://communities.sas.com/communications"&gt; (near&lt;/A&gt; to processors) and memory far away (dasd).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for 1/ which approach to do, you can choose to program any of those two (indexed like Btree or sequential)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for 3/ you can add/delete data/keys while using the hashes in a streamed data processing approach. Not possible with the others.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 07:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212560#M39273</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T07:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212561#M39274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi KurtBremser,&lt;/P&gt;&lt;P&gt;I am trying to understand you with the following example, please let me know if I am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume we have two SAS datasets, A and B (they are not sorted based on the by variables)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to match A and B, but every record of A can match multiple records in B so it is One to Many match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use data step merge statement, then many records from A will be selected and loaded to a buffer (memory) and many records from B will be selected and loaded a buffer (memory).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If records in the buffer&amp;nbsp; from A is NOT found in the buffer for records in B, then the buffer for B will be empty and another set of records will be selected from B into the buffer to match the records for A (in the buffer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this step will be repeated until all the matching records are found, so it can cause a lot of I/O (read data from disk).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Hash can solve this problem because it holds B so there is only one I/O to match with records from A( the number of I/O will be equal to number of records from A).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I am wrong please let me know why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe my understanding of buffer and I/O is wrong...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 08:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212561#M39274</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-04-01T08:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212562#M39275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;gyambqt,&amp;nbsp; There is no buffering involved in the merge logic only the current record-pointer as retrieved from the datasets is used. &lt;BR /&gt;You can use the point= &lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm"&gt;SAS(R) 9.4 Statements: Reference, Third Edition&lt;/A&gt; to move that record pointer around in the dataset. A very weird but possible effective way to handle datamerging.&amp;nbsp;&amp;nbsp; When the question is merging with a time-window that is present in the to be combined ordered data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Merging can be done with notsorted data. &lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#p0yeyftk8ftuckn1o5qzy53284gz.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#p0yeyftk8ftuckn1o5qzy53284gz.htm"&gt;SAS(R) 9.4 Statements: Reference, Third Edition&lt;/A&gt; (the by has a notsorted option).&lt;BR /&gt;Sorted data is well ordered data and ordered data is giving the best results with merging. But ordered does not need to be sorted. &lt;BR /&gt;Sounds strange the best example is a sorted dataset coming from an other environment with different encoding. That data is still nicely ordered but could have issues as not being sorted in the current encoding.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 08:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212562#M39275</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T08:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212563#M39276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;Do you mean in the data merge the data records for both datasets are loaded to PDV directly for matching? i thought the record would be loaded to buffer first then from buffer load to pdv for matching.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 08:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212563#M39276</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-04-01T08:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212564#M39277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forget your concern with the buffering, because you can NOT influence the cacheing that SAS does, apart from how much memory you grant it through MEMSIZE.&lt;/P&gt;&lt;P&gt;Anytime SAS accesses dataset(s), it tries to do some read-ahead etc based on its own logic, but you cannot influence that.&lt;/P&gt;&lt;P&gt;What you can influence is the number of logical reads to a certain object; the hash table is a method to guarantee that a certain object is read only once from disk and then kept in memory, now matter how often and in what sequence you access it.&lt;/P&gt;&lt;P&gt;When you have a simple 1 to 1 or 1 to n relationship based on a given key, sorting and merging is as simple as it can get. During the merge, SAS will go sequentially through the datasets, and perform some read-ahead based on its own memory parameters; meanwhile, the OS will also read ahead into the persistent system memory according to its own educated guesses based on process behaviour. Since the OS knows about all processes curently running (your SAS process only knows about itself), it is best to leave most of the work to the OS by keeping SAS memsize small in a multiuser environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you need to deal with a complex and mostly unpredictable relationship (eg reading a start and end date and match that with parameters about a given time range, like holidays - even in different regions!), then a hash table is a good method to prevent multiple random reads to the lookup table (or even multiple passes through the whole table), which will completely skewer all attempts by the OS to make intelligent decisions what to cache and what not for optimum system performance.&lt;/P&gt;&lt;P&gt;Randomized reads are also the primary cause for wait states in the storage subsystem, and bad overall performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 09:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212564#M39277</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-01T09:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212565#M39278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I was confused by the following link indeed:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_2.htm" title="http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_2.htm"&gt;http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_2.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It said&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SAS copies the data from the input data set to a buffer in memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;one observation at a time is loaded into the program data vector&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;each observation is written to an output buffer when processing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is complete&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;the contents of the output buffer are written to the disk when the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer is full&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 09:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212565#M39278</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-04-01T09:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212566#M39279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agree with Kurt. His remark to random access to the OS filesystem is an important one. It will diminish using SSD's but with the rotating harddisk-s those mechanical delays are the reason why a SQL approach can be slower&amp;nbsp; the sorting and merging.&lt;BR /&gt;Seen the turnaround for that a 10-20% partially data-access above that sequential is performing faster. Remember RDBMS with SQL where designed for OLTP and not for big data processing. Only at the moment of mass parallel processing SQL can gain in speed/performance. That is bringing you to &lt;A href="http://en.wikipedia.org/wiki/Parallel_computing" title="http://en.wikipedia.org/wiki/Parallel_computing"&gt;Parallel computing - Wikipedia, the free encyclopedia&lt;/A&gt; (HAdoop Teradata grid)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The PDV is only a SAS-datastep concept that is existent AFTER all data has come in. &lt;BR /&gt;The buffering of those records is not being controlled easily although you can do some things. As where and keep processing is done on those records indepently (dataset options). &lt;A href="http://support.sas.com/documentation/cdl/en/ledsoptsref/67381/HTML/default/viewer.htm#p0l3b7h13rpck6n17in4etoaoedm.htm" title="http://support.sas.com/documentation/cdl/en/ledsoptsref/67381/HTML/default/viewer.htm#p0l3b7h13rpck6n17in4etoaoedm.htm"&gt;SAS(R) 9.4 Data Set Options: Reference, Second Edition&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Just see those and realize they are outside the PDV scope.&amp;nbsp; &lt;A href="http://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/TASS/Mehatab-DataStepPDV.pdf" title="http://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/TASS/Mehatab-DataStepPDV.pdf"&gt;http://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/TASS/Mehatab-DataStepPDV.pdf&lt;/A&gt;&amp;nbsp; A nice presentation shows the buffer as interaction to your OS, all your data processing with the datastep on using the PDV. The where statement is confusing as it moved outside the PDV and executes before that. This is different to IF and Select/where as they process all data seen by the PDV. For performance it is the best no data that is needed coming in seen in the PDV. When optimizing outgoing data you can drop/keep those before getting out.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 09:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212566#M39279</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T09:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212567#M39280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have read the powerpoint about PDV, the buffer is still existed but according to kurt remarkthere is no good way to control how it read the data records on hard disk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read other people's remark, for 1 to 1 matching, there is no differencn between data step merge and hash table match in the aspect of i/o.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;since dataset are&amp;nbsp; accessed sequentially using data step merge. Shouldn't it cause more I/o than hash table match?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 10:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212567#M39280</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-04-01T10:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212568#M39281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The datastep merge by is NOT randomly accessing the data but does I sequentially. Sequentially access is for the OS (buffering) very predictable.&lt;BR /&gt;The overhead is caused by getting the data ordered first (the sorting).&amp;nbsp; The intermediate approach is using indexes. The index is sorted but the data that is retrieved isn't.&amp;nbsp; The most bad approach will be a sequential search from start for every record. &lt;/P&gt;&lt;P&gt;The most efficient one is "balance line" that is why that one is important and can be found in a RDBMS (explain paths etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Typical indexed access will cause a random IO pattern (normal with SQL). This one is the same as point= and indexed by usage with a SAS datastep.&lt;/P&gt;&lt;P&gt;Hash will avoid all IO but you can still do a "balance line" or index or restart from first obs with that. That is your choice using the hashes.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 10:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212568#M39281</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T10:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212569#M39282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THx jaap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 10:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212569#M39282</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-04-01T10:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212570#M39283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You say that for a hash "the more buckets the faster" but if I read the SAS documentation&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/lecompobjref/67221/HTML/default/viewer.htm#p00ilfw5pzcjvtn1nfya9863fozd.htm" title="http://support.sas.com/documentation/cdl/en/lecompobjref/67221/HTML/default/viewer.htm#p00ilfw5pzcjvtn1nfya9863fozd.htm"&gt;SAS(R) 9.4 Component Objects: Reference, Second Edition &lt;/A&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;then it states that for optimal performance the number of buckets must be in some relation to the number of items in a bucket.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have never found a fully satisfying explanation or guideline what this relationship should be or how to determine "automatically" the right exponent based on the number of records in the source table. SAS DI Studio uses some log() function to create dynamically a hash exponent but interestingly the result of this function returns a hashexp of "8" for 1 million records which is in contradiction to the documentation (link above) which states that a hashexp of 9 or 10 would result in the best performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any additional explanation or pointer to papers would be very welcome (I've read a few of Paul Dorfman's papers but couldn't really derive "my answer" out of these papers).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 11:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212570#M39283</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-01T11:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212571#M39284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;Almost the knowledge about Hash Table I learned is from &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Paul Dorfman's papers. Of course I know how to Hash Map of Jave, I learned it before . Go back to your question , you are right "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;the right exponent based on the number of records in the source table".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If you have only a couple of hundred obs and define lots of buckets like 2^20 , that would not bring you any advantage of speed , whereas it will cost you lots of memory . Therefore ,It is good for &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;SAS DI Studio uses some log() function to create dynamically a hash exponent . I actually have no idea how to decide the number of Hash Table's buckets . when I have a couple of millions obs , I used to use 20 .Maybe that is too waste . I don't know .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212571#M39284</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-04-01T12:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212572#M39285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I do not think SAS is using a Unique hash solution, the generic approach is described at &lt;A href="http://en.wikipedia.org/wiki/Hash_table" title="http://en.wikipedia.org/wiki/Hash_table"&gt;Hash table - Wikipedia, the free encyclopedia&lt;/A&gt;.&lt;BR /&gt;The approach of using the buckets/hashes is the same as optimizing the spread in a DBMS environment. Same logical question just a different area where it is applied. Cannot let it go. The SQL hash spreading the data is the application of the bucket/hash algorithm. The hash is used in a &lt;A href="http://www.tutorialspoint.com/dbms/dbms_file_structure.htm" title="http://www.tutorialspoint.com/dbms/dbms_file_structure.htm"&gt;DBMS File Structure&lt;/A&gt; to place records in some preferred page-areas (like buckets).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is avoiding the data movement within memory. Also that one can get costly. Imagine removing/adding 1 record of data would cause to remove all others around the memory. That will possible need a lot of cpu-instructions. Avoiding those will speed up (decrease) time.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;The details on the implemented hashing technique is less relevant. It can be changes and optimized by SAS (if you use that one) in time.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212572#M39285</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T12:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Advantage and disadvantage of hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212573#M39286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&lt;A href="http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_2.htm" title="http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_2.htm"&gt;http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_2.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_3.htm" title="http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_3.htm"&gt;http://web.utk.edu/sas/OnlineTutor/1.2/en/60477/m81/m81_3.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you read the above links(very short), it said :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SAS copies the data from the input data set to a buffer in memory&lt;/LI&gt;&lt;LI&gt;one observation at a time is loaded into the program data vector&lt;/LI&gt;&lt;LI&gt;A buffer can be treated as a container in memory that is big enough for only one page of data.&lt;/LI&gt;&lt;LI&gt;A&amp;nbsp; page is the unit of data transfer between the storage device and memory&lt;/LI&gt;&lt;LI&gt;The amount of data that can be transferred to one buffer in a single&amp;nbsp; I/O operation is referred to as &lt;STRONG&gt;page size&lt;/STRONG&gt;. Page size is analogous to buffer size for SAS data sets.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I think the buffer here means the SAS buffer rather than OS buffer(can we ignore OS here).&lt;/P&gt;&lt;P&gt;The size of buffer can be adjusted in SAS, the bigger it is , the more data it can be taken each time so consequently less I/O.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Question is: if buffer size is small, for example it only can take 10k records each time, but you have 50k records want to load to hash table. It still takes 5 I/O operations to transfer the 50k records from hard disk to hash(memory).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I think it is little bit different to your remark that only one I/O operation required to load the 50k records data from hard disk to hash.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My understanding of I/O is when data records from hard disk are read by SAS to SAS buffer. If SAS buffer size is small then it will require more I/O operation to finish reading complete dataset..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Do I have any problem to understand that?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 22:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Advantage-and-disadvantage-of-hash-table/m-p/212573#M39286</guid>
      <dc:creator>gyambqt</dc:creator>
      <dc:date>2015-04-01T22:54:36Z</dc:date>
    </item>
  </channel>
</rss>

