<?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: Looking for a better way in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490469#M128320</link>
    <description>&lt;P&gt;So you want a separate data set for each unique value of region, correct? There are several ways to do this, but my first question is: Why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is rarely a good idea to split a data set like this. Instead use By-Group processing on the original data set.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Aug 2018 14:13:43 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-08-28T14:13:43Z</dc:date>
    <item>
      <title>Looking for a better way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490466#M128318</link>
      <description>&lt;P&gt;Hi. I need the individual all_volume for each region.&amp;nbsp; Currently I run this in 3 different data steps (see below). I'm wondering if there's a Proc I could us instead?&amp;nbsp; And if you could help with the syntax for it?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Want as&lt;BR /&gt;select sum(a_volume+b_volume+c_volume) AS all_volume&lt;BR /&gt;from&amp;nbsp;Have&lt;BR /&gt;where region = '1'&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;create table Want as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;select sum(a_volume+b_volume+c_volume) AS all_volume&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from&amp;nbsp;Have&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where region = '2'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;create table Want as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;select sum(a_volume+b_volume+c_volume) AS all_volume&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from&amp;nbsp;Have&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where region = '3'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;quit;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490466#M128318</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2018-08-28T14:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a better way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490469#M128320</link>
      <description>&lt;P&gt;So you want a separate data set for each unique value of region, correct? There are several ways to do this, but my first question is: Why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is rarely a good idea to split a data set like this. Instead use By-Group processing on the original data set.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490469#M128320</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-28T14:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a better way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490471#M128322</link>
      <description>&lt;P&gt;Do not split data.&amp;nbsp; SAS is based on the by group principal.&amp;nbsp; One dataset with groups of data, so:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table want as
  select  region,
          sum(a_volume+b_volume+c_volume) as all_volume
  from    have
  group by region;
quit;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490471#M128322</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-28T14:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a better way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490477#M128325</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;is right IMHO.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Split_Data_into_Subsets" target="_blank"&gt;http://www.sascommunity.org/wiki/Split_Data_into_Subsets&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490477#M128325</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-28T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a better way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490479#M128326</link>
      <description>&lt;P&gt;Thanks so much for your time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490479#M128326</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2018-08-28T14:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a better way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490481#M128327</link>
      <description>&lt;P&gt;No, sorry I wasn't more clear on that.&amp;nbsp; I'm just plugging them into a spreadsheet so a single output is ideal.&amp;nbsp; Sorry again.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:35:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-better-way/m-p/490481#M128327</guid>
      <dc:creator>buechler66</dc:creator>
      <dc:date>2018-08-28T14:35:31Z</dc:date>
    </item>
  </channel>
</rss>

