<?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: Splitting one table into Multiple tables in a faster way in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211656#M52277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know if data set options would run faster than if then else&lt;/P&gt;&lt;P&gt;DATA TWO (where=(id='1')) THREE (where=(id='2')) FOUR (where=(id='3'));&lt;/P&gt;&lt;P&gt;SET ONE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or a slightly less verbose way to get the equivalent of if then else which gets better looking if doing 10 statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TWO THREE FOUR;&lt;/P&gt;&lt;P&gt;SET ONE;&lt;/P&gt;&lt;P&gt;select (id);&lt;/P&gt;&lt;P&gt;when('1') OUTPUT TWO;&lt;/P&gt;&lt;P&gt;when('2') OUTPUT THREE;&lt;/P&gt;&lt;P&gt;when('3') output&amp;nbsp; FOUR;&lt;/P&gt;&lt;P&gt;otherwise Put "Unexpected value for ID"&amp;nbsp; id;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2015 16:03:50 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-07-28T16:03:50Z</dc:date>
    <item>
      <title>Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211651#M52272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset with contains million reocrds and i want to split the table into multiple tables&amp;nbsp; based on one field with out using Data step.If we can do it Sql that is very much usefull for us.&lt;/P&gt;&lt;P&gt;why i'm preferring sql is in data step while splititng the data it is taking so much time but my intension is to reduce the execution time and workspace also.So can some one suggest if we have any other ways to split the data into mulitiple ways in a faster way.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 13:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211651#M52272</guid>
      <dc:creator>SonyTrinesh</dc:creator>
      <dc:date>2015-07-27T13:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211652#M52273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL will not be any quicker that datastep.&amp;nbsp; in fact, it is likely to be slower within SAS.&amp;nbsp; I would suggest you start by posting your datastep code.&amp;nbsp; There maybe ways to reduce the processing if we see your code.&amp;nbsp; For instance have you tried, something like:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table LOOP as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distinct THE_SPLIT_VAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set loop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('data '||strip(the_split_var)||'; set have (where=(the_split_var="'||strip(the_strip_var)||'")); run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above will create a small datastep for each distinct split, with a small where on the read in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 13:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211652#M52273</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-27T13:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211653#M52274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1 million records should be nothing for SAS to process and you shouldn't need to split it up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That being said, a hash method is usually the fastest to run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See samples of codes of various methods here:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.sascommunity.org/wiki/Split_Data_into_Subsets" title="http://www.sascommunity.org/wiki/Split_Data_into_Subsets"&gt;Split Data into Subsets - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your data is sorted a call execute is another good way, but you should post your code that you've tried so far. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 14:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211653#M52274</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-27T14:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211654#M52275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the code i've used for spliting the table into multiple tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA ONE;&lt;/P&gt;&lt;P&gt;INPUT ID $ ;&lt;/P&gt;&lt;P&gt;CARDS;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TWO THREE FOUR;&lt;/P&gt;&lt;P&gt;SET ONE;&lt;/P&gt;&lt;P&gt;IF ID='1' THEN OUTPUT WORK.TWO;&lt;/P&gt;&lt;P&gt;IF ID='2' THEN OUTPUT WORK.THREE;&lt;/P&gt;&lt;P&gt;IF ID='3' THEN OUTPUT WORK.FOUR;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one suggest faster way to split the tables in Data step or&amp;nbsp; in Sql.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 11:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211654#M52275</guid>
      <dc:creator>SonyTrinesh</dc:creator>
      <dc:date>2015-07-28T11:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211655#M52276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's basically how you would do it and nothing will be faster - except you would want to use "ELSE" as well and if you want to take it to the "extreme" you would order your "if.. then... else.." statements along "probability" having the most likely cases first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...but as others already wrote: A million records is "nothing" so splitting up the data set feels like the wrong thing to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 11:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211655#M52276</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-07-28T11:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211656#M52277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know if data set options would run faster than if then else&lt;/P&gt;&lt;P&gt;DATA TWO (where=(id='1')) THREE (where=(id='2')) FOUR (where=(id='3'));&lt;/P&gt;&lt;P&gt;SET ONE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or a slightly less verbose way to get the equivalent of if then else which gets better looking if doing 10 statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TWO THREE FOUR;&lt;/P&gt;&lt;P&gt;SET ONE;&lt;/P&gt;&lt;P&gt;select (id);&lt;/P&gt;&lt;P&gt;when('1') OUTPUT TWO;&lt;/P&gt;&lt;P&gt;when('2') OUTPUT THREE;&lt;/P&gt;&lt;P&gt;when('3') output&amp;nbsp; FOUR;&lt;/P&gt;&lt;P&gt;otherwise Put "Unexpected value for ID"&amp;nbsp; id;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 16:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/211656#M52277</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-28T16:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/559937#M74858</link>
      <description>What if my variable that I want to distinct is a date ? Is there any specific program for that ?</description>
      <pubDate>Sun, 19 May 2019 06:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/559937#M74858</guid>
      <dc:creator>Demarez</dc:creator>
      <dc:date>2019-05-19T06:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one table into Multiple tables in a faster way</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/559939#M74859</link>
      <description>One additional step that sometimes helps:  fix the data.  You will have to check whether this applies here.&lt;BR /&gt;&lt;BR /&gt;Depending on how the original data was created, it's possible that character variables use much more space than they should.  For example, perhaps a variable named GENDER should be "F" or "M" but is actually defined as $200 characters long.  That's a problem.  Moving around data that is 200 times bigger than it needs to be takes significantly longer.&lt;BR /&gt;&lt;BR /&gt;Compressing the data can reclaim the storage space, but actually takes longer to process.  Each time you use the data it needs to be uncompressed, adding to the processing time.  Also worth noting:  even if the original data set is compressed, that doesn't mean that the subsets will be compressed.</description>
      <pubDate>Sun, 19 May 2019 09:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-table-into-Multiple-tables-in-a-faster-way/m-p/559939#M74859</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-19T09:10:36Z</dc:date>
    </item>
  </channel>
</rss>

