<?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 How grouping work in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786795#M251255</link>
    <description>&lt;P&gt;Hello team&lt;/P&gt;
&lt;P&gt;why don't I get a group by this code?&lt;/P&gt;
&lt;PRE&gt;data test1;
input id sys dia;
datalines;
1 23 24
1 23 24
2 12 13
;
Run;&lt;BR /&gt;&lt;BR /&gt;data grouping;&lt;BR /&gt;set test1;&lt;BR /&gt;by id sys dia;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;Am I not supposed to get only for rows for 1 23 24? Please advise me.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Blueblue&lt;/P&gt;</description>
    <pubDate>Mon, 20 Dec 2021 17:50:35 GMT</pubDate>
    <dc:creator>GN0001</dc:creator>
    <dc:date>2021-12-20T17:50:35Z</dc:date>
    <item>
      <title>How grouping work in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786795#M251255</link>
      <description>&lt;P&gt;Hello team&lt;/P&gt;
&lt;P&gt;why don't I get a group by this code?&lt;/P&gt;
&lt;PRE&gt;data test1;
input id sys dia;
datalines;
1 23 24
1 23 24
2 12 13
;
Run;&lt;BR /&gt;&lt;BR /&gt;data grouping;&lt;BR /&gt;set test1;&lt;BR /&gt;by id sys dia;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;Am I not supposed to get only for rows for 1 23 24? Please advise me.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Blueblue&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 17:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786795#M251255</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-12-20T17:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: How grouping work in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786798#M251257</link>
      <description>&lt;P&gt;I don't get your question: "&lt;SPAN&gt;Am I not supposed to get only for rows for 1 23 24?&lt;/SPAN&gt;", but if I were you I would start by reading the documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/n1ecf3exv3sn7bn1htxoz074c72z.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/n1ecf3exv3sn7bn1htxoz074c72z.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 17:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786798#M251257</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-12-20T17:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: How grouping work in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786799#M251258</link>
      <description>&lt;P&gt;What do you mean by "group" here? This is not really a word that describes any SAS structure that I know of.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 17:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786799#M251258</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-20T17:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: How grouping work in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786800#M251259</link>
      <description>&lt;P&gt;You are creating GROUPING as a copy of TEST1.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only thing the BY statement will do in that data step is insure that TEST1 is actually sorted by ID SYS DIA.&amp;nbsp; It for example an observation with ID=1 came after on observation with ID=2 it would generate an error since the that is not the sort order you told the BY statement to expect.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 17:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786800#M251259</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-20T17:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How grouping work in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786803#M251261</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;What I mean is to receive one observation for those rows that are same if those observations are sorted properly. I don't know what word I need to use instead of grouping. I know in SAS before grouping, I need to sort my data.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 18:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786803#M251261</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-12-20T18:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: How grouping work in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786805#M251262</link>
      <description>&lt;P&gt;If you want to reduce the data to one observation per BY group you could use the NODUPKEY option on PROC SORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if the goal is to sort by ID SYS DIA and then reduce it to one observation per value of ID then you can get the FIRST.ID automatic flag that the BY statement creates.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have ;
  by id sys dia ;
run;
data min_blood_pressure;
  set have;
  by id sys dia;
  if first.id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Dec 2021 18:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-grouping-work-in-SAS/m-p/786805#M251262</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-20T18:40:52Z</dc:date>
    </item>
  </channel>
</rss>

