<?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: split a data set into multiple data sets using macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551659#M153293</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would say that the clever way to do it is not to do it and rather use by group processing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    CREATE TABLE cars AS
    SELECT DISTINCT length
    FROM sashelp.cars;
quit;

data _NULL_;
    set cars;
    call execute(cats('data tbl_',length,'; set sashelp.cars; where length=',length,'; run;'));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2019 11:56:13 GMT</pubDate>
    <dc:creator>gamotte</dc:creator>
    <dc:date>2019-04-17T11:56:13Z</dc:date>
    <item>
      <title>split a data set into multiple data sets using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551651#M153290</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Let's say that I want to split data set sashelp.cars into multiple datasets by the value of field "Length".&lt;/P&gt;
&lt;P&gt;I expect to get 67 data sets because there are 67 distinct values of&amp;nbsp;field "Length".&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;Name of data set for rows with&amp;nbsp;Length=143 should be tbl_143&lt;/P&gt;
&lt;P&gt;Name of data set for rows with&amp;nbsp;Length=169 should be tbl_169&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the clever way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 11:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551651#M153290</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-04-17T11:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: split a data set into multiple data sets using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551659#M153293</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would say that the clever way to do it is not to do it and rather use by group processing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    CREATE TABLE cars AS
    SELECT DISTINCT length
    FROM sashelp.cars;
quit;

data _NULL_;
    set cars;
    call execute(cats('data tbl_',length,'; set sashelp.cars; where length=',length,'; run;'));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 11:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551659#M153293</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-04-17T11:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: split a data set into multiple data sets using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551679#M153298</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote a macro for this exact purpose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Splitting-a-SAS-data-set/ta-p/517960" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Splitting-a-SAS-data-set/ta-p/517960&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 12:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551679#M153298</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-04-17T12:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: split a data set into multiple data sets using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551683#M153301</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30622"&gt;@gamotte&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would say that the clever way to do it is not to do it and rather use by group processing.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, indeed! Not splitting up data sets is the most clever thing to do, because it simplifies your programming and takes advantage of things SAS has already programmed for your benefit.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 12:43:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/split-a-data-set-into-multiple-data-sets-using-macro/m-p/551683#M153301</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-17T12:43:17Z</dc:date>
    </item>
  </channel>
</rss>

