<?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 Combining multiple big tables - set or hash table? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Combining-multiple-big-tables-set-or-hash-table/m-p/623586#M183611</link>
    <description>&lt;P&gt;I would like to set 12 tables (this scope can change, f.e. it can be 36 tables from: 2017, 2018, and 2019 year), where&amp;nbsp;one table&amp;nbsp;has&amp;nbsp;about 20 milions rows.&lt;/P&gt;&lt;P&gt;I thought about creating view (at this moment only for year 2019):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tab01_1/ &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;view&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=tab01_1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tab01_2019:&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then I cannot make any operations on the view. f.e. when I try make proc sort, I have an error:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = tab01_1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Cannot sort in place.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Unable to create WORK.tab01_1.DATA because WORK.tab01_1.VIEW already exists&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;What is the best way to set tables? Can I uIse UNION operator instead of SET?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Or maybe hash tables&amp;nbsp;will be&amp;nbsp;a good option? How it should look like for so many tables and records? &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;After creating so big table can I make some operations on its then?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2020 15:39:34 GMT</pubDate>
    <dc:creator>MargoBlue</dc:creator>
    <dc:date>2020-02-10T15:39:34Z</dc:date>
    <item>
      <title>Combining multiple big tables - set or hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-multiple-big-tables-set-or-hash-table/m-p/623586#M183611</link>
      <description>&lt;P&gt;I would like to set 12 tables (this scope can change, f.e. it can be 36 tables from: 2017, 2018, and 2019 year), where&amp;nbsp;one table&amp;nbsp;has&amp;nbsp;about 20 milions rows.&lt;/P&gt;&lt;P&gt;I thought about creating view (at this moment only for year 2019):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tab01_1/ &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;view&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=tab01_1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tab01_2019:&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then I cannot make any operations on the view. f.e. when I try make proc sort, I have an error:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = tab01_1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Cannot sort in place.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Unable to create WORK.tab01_1.DATA because WORK.tab01_1.VIEW already exists&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;What is the best way to set tables? Can I uIse UNION operator instead of SET?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Or maybe hash tables&amp;nbsp;will be&amp;nbsp;a good option? How it should look like for so many tables and records? &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;After creating so big table can I make some operations on its then?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 15:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-multiple-big-tables-set-or-hash-table/m-p/623586#M183611</guid>
      <dc:creator>MargoBlue</dc:creator>
      <dc:date>2020-02-10T15:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Combining multiple big tables - set or hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-multiple-big-tables-set-or-hash-table/m-p/623588#M183612</link>
      <description>&lt;P&gt;You cannot overwrite a view with a dataset with the same name. Just tell PROC SORT what dataset you want to write the sorted data into.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = tab01_1 out=tab01_1_sorted;
  by id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that if the original datasets that the view is reading are already sorted you can preserve the order by adding the BY to the view definition and eliminate the need to make a copy into a sorted dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tab01_1/ view=tab01_1;
  set tab01_2019:;
  by id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Feb 2020 15:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-multiple-big-tables-set-or-hash-table/m-p/623588#M183612</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-10T15:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Combining multiple big tables - set or hash table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combining-multiple-big-tables-set-or-hash-table/m-p/623597#M183620</link>
      <description>&lt;P&gt;In general it is much easier to keep the data for all years in one dataset and then use WHERE statement when using it to limit to the range you want.&amp;nbsp; But whether that will work for you depends on&amp;nbsp;how it is created and how it is used.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 16:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combining-multiple-big-tables-set-or-hash-table/m-p/623597#M183620</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-10T16:01:28Z</dc:date>
    </item>
  </channel>
</rss>

