<?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: Row by row duplicate compare and flag in both in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866011#M342002</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439615"&gt;@Madhav4114&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;In this , if I add one more duplicate row then it will flag 0 in between&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id date;
flag = (not first.date or not last.date);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Mar 2023 22:27:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-03-23T22:27:50Z</dc:date>
    <item>
      <title>Row by row duplicate compare and flag in both</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866000#M341994</link>
      <description>Input&lt;BR /&gt;Id. Date&lt;BR /&gt;1. 200701&lt;BR /&gt;1 200701&lt;BR /&gt;1 200702&lt;BR /&gt;2 201001&lt;BR /&gt;2 201002&lt;BR /&gt;2. 201002&lt;BR /&gt;Need output where in flag has 1 for both duplicate rows&lt;BR /&gt;&lt;BR /&gt;Output&lt;BR /&gt;Id Date flag&lt;BR /&gt;1. 200701. 1&lt;BR /&gt;1 200701. 1&lt;BR /&gt;1 200702. 0&lt;BR /&gt;2 201001. 0&lt;BR /&gt;2 201002. 1&lt;BR /&gt;2. 201002. 1&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Mar 2023 21:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866000#M341994</guid>
      <dc:creator>Madhav4114</dc:creator>
      <dc:date>2023-03-23T21:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row duplicate compare and flag in both</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866004#M341997</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id date;
flag = (first.date ne last.date);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2023 21:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866004#M341997</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-23T21:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row duplicate compare and flag in both</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866005#M341998</link>
      <description>In this , if I add one more duplicate row then it will flag 0 in between</description>
      <pubDate>Thu, 23 Mar 2023 21:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866005#M341998</guid>
      <dc:creator>Madhav4114</dc:creator>
      <dc:date>2023-03-23T21:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row duplicate compare and flag in both</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866010#M342001</link>
      <description>&lt;P&gt;Here's a variation to take care of that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   by id date;
   retain flag 0;
   if first.date then 
      flag = (last.date=0);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2023 22:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866010#M342001</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-03-23T22:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row duplicate compare and flag in both</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866011#M342002</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439615"&gt;@Madhav4114&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;In this , if I add one more duplicate row then it will flag 0 in between&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id date;
flag = (not first.date or not last.date);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2023 22:27:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-duplicate-compare-and-flag-in-both/m-p/866011#M342002</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-23T22:27:50Z</dc:date>
    </item>
  </channel>
</rss>

