<?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: flag nonidentical values within a group in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/flag-nonidentical-values-within-a-group/m-p/772185#M2614</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/394090"&gt;@wcw2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll need an additional variable (like variable &lt;FONT face="courier new,courier"&gt;grp&lt;/FONT&gt; in the example below) designating the groups or some other criterion to tell SAS where a new group begins.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input grp GROUPNO;
cards;
1 6
1 6
1 6
1 5
1 6
1 6
1 6
2 20
2 21
2 20
2 20
2 20
;

data want(drop=_g1);
set have;
by grp;  /* add NOTSORTED option if needed */
if first.grp then _g1=groupno;
else if groupno ne _g1 then FLAG='x';
retain _g1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Oct 2021 15:01:44 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2021-10-05T15:01:44Z</dc:date>
    <item>
      <title>flag nonidentical values within a group</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/flag-nonidentical-values-within-a-group/m-p/772169#M2613</link>
      <description>&lt;P&gt;I need to do a data check that will flag any numeric values that are not identical to others in a group, see below. The first GROUPNO value of each group will always be correct. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OBS&amp;nbsp; &amp;nbsp;GROUPNO&amp;nbsp; &amp;nbsp;FLAG (want)&lt;BR /&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;BR /&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;BR /&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x&lt;BR /&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;BR /&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;BR /&gt;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;BR /&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;BR /&gt;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x&lt;BR /&gt;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;BR /&gt;11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;BR /&gt;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 14:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/flag-nonidentical-values-within-a-group/m-p/772169#M2613</guid>
      <dc:creator>wcw2</dc:creator>
      <dc:date>2021-10-05T14:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: flag nonidentical values within a group</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/flag-nonidentical-values-within-a-group/m-p/772185#M2614</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/394090"&gt;@wcw2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll need an additional variable (like variable &lt;FONT face="courier new,courier"&gt;grp&lt;/FONT&gt; in the example below) designating the groups or some other criterion to tell SAS where a new group begins.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input grp GROUPNO;
cards;
1 6
1 6
1 6
1 5
1 6
1 6
1 6
2 20
2 21
2 20
2 20
2 20
;

data want(drop=_g1);
set have;
by grp;  /* add NOTSORTED option if needed */
if first.grp then _g1=groupno;
else if groupno ne _g1 then FLAG='x';
retain _g1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Oct 2021 15:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/flag-nonidentical-values-within-a-group/m-p/772185#M2614</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-10-05T15:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: flag nonidentical values within a group</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/flag-nonidentical-values-within-a-group/m-p/772199#M2615</link>
      <description>&lt;P&gt;Yes indeed. Thanks so very much!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 15:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/flag-nonidentical-values-within-a-group/m-p/772199#M2615</guid>
      <dc:creator>wcw2</dc:creator>
      <dc:date>2021-10-05T15:16:28Z</dc:date>
    </item>
  </channel>
</rss>

