<?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: SAS Duplicate Indicator in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Duplicate-Indicator/m-p/304427#M312481</link>
    <description>&lt;P&gt;It helps to provide data. See if this helps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.set1;
   input   mbr_num client_id_count;
datalines;
1     1
2     2
3     1
4     4
;
run;

data work.set2;
   input mbr_num client_id $;
datalines;
1  abc
2  pdq
2  xyz
3  jjj
4  eft
4  ghe
4  jkl
4  mno
;
run;

data work.want;
   merge
      work.set2 (In=In2 )
      work.set1 (In=In1 where=(client_id_count&amp;gt;1))
  ;
  by mbr_num;
  if first.mbr_num and In2 and In1 then Flag=1;
  drop  client_id_count;
run;
      &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Oct 2016 17:17:13 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-10-13T17:17:13Z</dc:date>
    <item>
      <title>SAS Duplicate Indicator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Duplicate-Indicator/m-p/304424#M312480</link>
      <description>&lt;P&gt;&amp;nbsp;So I have an issue that I am not sure how to solve. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two datasets:&lt;/P&gt;
&lt;P&gt;Dataset 1: mbr_num, client_id_count&lt;/P&gt;
&lt;P&gt;Dataset 2: mbr_num, client_id&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my first dataset shows the member number and the number of clients the member number is associated with. &amp;nbsp;Dataset 2 is showing just the member number and the client id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to be able to build an if statement that will do the following:&lt;/P&gt;
&lt;P&gt;1) Flag the mbr_num on the 2nd dataset that has a duplicate (associated to more than 1 client id)&lt;/P&gt;
&lt;P&gt;2) Only flag the first instence of the member who has a duplicate (if.first type statement)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So that is basically it. &amp;nbsp;I am just not sure the syntax to use to best bring that together. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using Base SAS 9.2&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 17:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Duplicate-Indicator/m-p/304424#M312480</guid>
      <dc:creator>IgawaKei29</dc:creator>
      <dc:date>2016-10-13T17:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Duplicate Indicator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Duplicate-Indicator/m-p/304427#M312481</link>
      <description>&lt;P&gt;It helps to provide data. See if this helps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.set1;
   input   mbr_num client_id_count;
datalines;
1     1
2     2
3     1
4     4
;
run;

data work.set2;
   input mbr_num client_id $;
datalines;
1  abc
2  pdq
2  xyz
3  jjj
4  eft
4  ghe
4  jkl
4  mno
;
run;

data work.want;
   merge
      work.set2 (In=In2 )
      work.set1 (In=In1 where=(client_id_count&amp;gt;1))
  ;
  by mbr_num;
  if first.mbr_num and In2 and In1 then Flag=1;
  drop  client_id_count;
run;
      &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2016 17:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Duplicate-Indicator/m-p/304427#M312481</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-13T17:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Duplicate Indicator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Duplicate-Indicator/m-p/304450#M312482</link>
      <description>&lt;P&gt;Hey thanks so much. &amp;nbsp;This worked really well with my code.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Duplicate-Indicator/m-p/304450#M312482</guid>
      <dc:creator>IgawaKei29</dc:creator>
      <dc:date>2016-10-13T18:56:38Z</dc:date>
    </item>
  </channel>
</rss>

