<?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 by Group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/by-Group/m-p/770556#M244480</link>
    <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;Can any one explain this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When an observation is the first in a by group, sas set the value of first.variable to 1. This happens when the value of the variable changed from the previous observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;b. For all other observations in the by group. they value of first.variable is 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does section b mean that all other observations in the same group or other groups?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please elaborate this?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Sep 2021 01:59:31 GMT</pubDate>
    <dc:creator>GN0001</dc:creator>
    <dc:date>2021-09-27T01:59:31Z</dc:date>
    <item>
      <title>by Group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/by-Group/m-p/770556#M244480</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;Can any one explain this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When an observation is the first in a by group, sas set the value of first.variable to 1. This happens when the value of the variable changed from the previous observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;b. For all other observations in the by group. they value of first.variable is 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does section b mean that all other observations in the same group or other groups?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please elaborate this?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 01:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/by-Group/m-p/770556#M244480</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-09-27T01:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: by Group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/by-Group/m-p/770559#M244483</link>
      <description>&lt;P&gt;Try it and see.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
  by sex;
run;

data test;
  set class;
  by sex;
  first_sex = first.sex;
  last_sex = last.sex;
run;

proc print;
  var first_sex last_sex sex name;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Sep 2021 02:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/by-Group/m-p/770559#M244483</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-27T02:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: by Group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/by-Group/m-p/770560#M244484</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;When an observation is the first in a by group, sas set the value of first.variable to 1. ..&lt;SPAN style="font-family: inherit;"&gt;. For all other observations in the by group. they value of first.variable is 0.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;That's how this is supposed to work. Your question is nuclear.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 02:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/by-Group/m-p/770560#M244484</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-09-27T02:16:04Z</dc:date>
    </item>
  </channel>
</rss>

