<?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: Duplicate comments in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Duplicate-comments/m-p/839221#M331835</link>
    <description>&lt;P&gt;Make a new variable and use it sort/group the data.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  row+1;
  ucomment = upcase(compbl(comment));
run;

proc sort;
  by ucomment row;
run;

data want;
  set want;
  by ucomment;
  if first.ucomment;
run;

proc sort;
  by row;
run;

proc print;
 var row comment;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1666108411753.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76277i657DA3E70266BDA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1666108411753.png" alt="Tom_0-1666108411753.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 15:53:44 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-10-18T15:53:44Z</dc:date>
    <item>
      <title>Duplicate comments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Duplicate-comments/m-p/839216#M331831</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a&amp;nbsp; long comment variable and I will like to separate any duplicates comment from non-duplicate comments. I just don't want to use&amp;nbsp; first.comment because some comment are the same at the initial sentences but later are different.( That is the entire sentence case is not the same). I have provided a sample data. Can I use proc sql if yes please provide a sample code. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;length comment $ 1000;&lt;BR /&gt;input comment$ 1 - 1000;&lt;BR /&gt;datalines;&lt;BR /&gt;Since it is impossible to completely and completely quit using dependent drugs, it is better to face drug abuse with a positive, rational and practical attitude and point of view&lt;BR /&gt;Substance abuse refers to the intermittent or persistent excessive use of psychoactive substances that is contrary to social norms or is irrelevant or inconsistent with accepted medical practice.Such abuse is far from tentative use, social entertainment or situational need, but gradually turns into a state of intensive use, which leads to the formation of dependence.&lt;BR /&gt;Substance abuse refers to the intermittent or persistent excessive use of psychoactive substances that is contrary to social norms or is irrelevant or inconsistent with accepted medical practice.Such abuse is far from tentative use, social entertainment or situational need, but gradually turns into a state of intensive use, which leads to the formation of dependence.&lt;BR /&gt;Need safe spaces and safe disposable sites&lt;BR /&gt;Need safe spaces and safe disposable sites&lt;BR /&gt;More attention has been paid to the concept of harm reduction.&lt;BR /&gt;NO&lt;BR /&gt;No opinion&lt;BR /&gt;Marijuana should be legal.&lt;BR /&gt;Need safe spaces and safe disposable sites&lt;BR /&gt;The use of drugs should be vigorously suppressed&lt;BR /&gt;The use of drugs should be vigorously suppressed&lt;BR /&gt;Very bad behavior&lt;BR /&gt;Need safe spaces and safe disposable sites&lt;BR /&gt;Increase control&lt;BR /&gt;nothing&lt;BR /&gt;nothing&lt;BR /&gt;I just hope there will be when I need it&lt;BR /&gt;I just hope there will be when I need it&lt;BR /&gt;Increase control&lt;BR /&gt;No opinion&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 15:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Duplicate-comments/m-p/839216#M331831</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2022-10-18T15:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate comments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Duplicate-comments/m-p/839221#M331835</link>
      <description>&lt;P&gt;Make a new variable and use it sort/group the data.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  row+1;
  ucomment = upcase(compbl(comment));
run;

proc sort;
  by ucomment row;
run;

data want;
  set want;
  by ucomment;
  if first.ucomment;
run;

proc sort;
  by row;
run;

proc print;
 var row comment;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1666108411753.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76277i657DA3E70266BDA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1666108411753.png" alt="Tom_0-1666108411753.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 15:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Duplicate-comments/m-p/839221#M331835</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-18T15:53:44Z</dc:date>
    </item>
  </channel>
</rss>

