<?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 PRO SQL GROUP BY CLAUSE in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PRO-SQL-GROUP-BY-CLAUSE/m-p/476254#M71206</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table total2 as
select idnumber, jobcode, sale1, sale2, sum(sale1) as s1, sum(sale2) as s2,
           sum(sale1, sale2) as s3
 from sumy
 group by jobcode;
 quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21637i1EBDACF258AFDC60/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello , is anybody can tell me about the order of observations in each group &amp;nbsp;without having clause and order by clause when group by clause?&lt;/P&gt;&lt;P&gt;In the attachment and code, the table total is the original data, after using groupy by clause, the entire data is grouped by jobcode shown in table total2. However, I found the order of observations in each group is werid. I assume the order should be sequencial as the original data, but is wasn't.&lt;/P&gt;&lt;P&gt;Order by clause can modify the order in each group, if there is no order by clause, what's the order convention in &amp;nbsp;each group, which is my concern.&lt;/P&gt;&lt;P&gt;Hope anyone can explain it for me.&lt;/P&gt;&lt;P&gt;Many thanks!&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>Sun, 08 Jul 2018 03:39:27 GMT</pubDate>
    <dc:creator>Karen_sas11</dc:creator>
    <dc:date>2018-07-08T03:39:27Z</dc:date>
    <item>
      <title>PRO SQL GROUP BY CLAUSE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PRO-SQL-GROUP-BY-CLAUSE/m-p/476254#M71206</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table total2 as
select idnumber, jobcode, sale1, sale2, sum(sale1) as s1, sum(sale2) as s2,
           sum(sale1, sale2) as s3
 from sumy
 group by jobcode;
 quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21637i1EBDACF258AFDC60/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello , is anybody can tell me about the order of observations in each group &amp;nbsp;without having clause and order by clause when group by clause?&lt;/P&gt;&lt;P&gt;In the attachment and code, the table total is the original data, after using groupy by clause, the entire data is grouped by jobcode shown in table total2. However, I found the order of observations in each group is werid. I assume the order should be sequencial as the original data, but is wasn't.&lt;/P&gt;&lt;P&gt;Order by clause can modify the order in each group, if there is no order by clause, what's the order convention in &amp;nbsp;each group, which is my concern.&lt;/P&gt;&lt;P&gt;Hope anyone can explain it for me.&lt;/P&gt;&lt;P&gt;Many thanks!&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>Sun, 08 Jul 2018 03:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PRO-SQL-GROUP-BY-CLAUSE/m-p/476254#M71206</guid>
      <dc:creator>Karen_sas11</dc:creator>
      <dc:date>2018-07-08T03:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: PRO SQL GROUP BY CLAUSE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PRO-SQL-GROUP-BY-CLAUSE/m-p/476265#M71210</link>
      <description>&lt;P&gt;It's undetermined, and an effect of the order in which observations are read from the utility file when the output is written.&lt;/P&gt;
&lt;P&gt;Always specify the order yourself if you need a specific one.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2018 05:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PRO-SQL-GROUP-BY-CLAUSE/m-p/476265#M71210</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-08T05:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: PRO SQL GROUP BY CLAUSE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PRO-SQL-GROUP-BY-CLAUSE/m-p/476287#M71211</link>
      <description>&lt;P&gt;Thank you Kurt, now I get it.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2018 14:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PRO-SQL-GROUP-BY-CLAUSE/m-p/476287#M71211</guid>
      <dc:creator>Karen_sas11</dc:creator>
      <dc:date>2018-07-08T14:27:45Z</dc:date>
    </item>
  </channel>
</rss>

