<?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: how to find duplicate values in different variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-duplicate-values-in-different-variables/m-p/642892#M191844</link>
    <description>&lt;P&gt;please try the below code which will output the dataset with count variable to check the dupliates&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input week1$ week2$ week3$;
datalines;
cat    human  cat
dog    bird   human
mouse  fish   horse
human  lizard rabbit
;
run;

data two;
set one;
week='week1';
values=week1;
output;
week='week2';
values=week2;
output;
week='week3';
values=week3;
output;
run;

proc sort data=two;
by values;
run;

data the;
do until(last.values);
set two;
by values;
retain count;
if first.values then count=1;
else count+1;
end;
do until(last.values);
set two;
by values;
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 25 Apr 2020 16:20:01 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2020-04-25T16:20:01Z</dc:date>
    <item>
      <title>how to find duplicate values in different variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-duplicate-values-in-different-variables/m-p/642888#M191842</link>
      <description>&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an excel sheet with infinite amount of columns added weekly.&amp;nbsp; I need to find if the additional columns added weekly have the same values of existing ones.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a sample dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data one;
input $week1 $week2 $week3;
datalines;
cat    human  cat
dog    bird   human
mouse  fish   horse
human  lizard rabbit
;
run;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see "human" occurred 3 times (week1 ,2 ,3) and "cat" occurred 2 times(week 1,3).&amp;nbsp; How can I output a dataset that can identify these duplicates? thank you&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 16:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-duplicate-values-in-different-variables/m-p/642888#M191842</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-04-25T16:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to find duplicate values in different variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-duplicate-values-in-different-variables/m-p/642892#M191844</link>
      <description>&lt;P&gt;please try the below code which will output the dataset with count variable to check the dupliates&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input week1$ week2$ week3$;
datalines;
cat    human  cat
dog    bird   human
mouse  fish   horse
human  lizard rabbit
;
run;

data two;
set one;
week='week1';
values=week1;
output;
week='week2';
values=week2;
output;
week='week3';
values=week3;
output;
run;

proc sort data=two;
by values;
run;

data the;
do until(last.values);
set two;
by values;
retain count;
if first.values then count=1;
else count+1;
end;
do until(last.values);
set two;
by values;
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Apr 2020 16:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-duplicate-values-in-different-variables/m-p/642892#M191844</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-04-25T16:20:01Z</dc:date>
    </item>
  </channel>
</rss>

