<?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: create unique id for duplicates referencing the same customer in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231607#M1140</link>
    <description>&lt;P&gt;"(Operational Research algorithm) but I'm not sure I&amp;nbsp;have the licence for it"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Submit&lt;/P&gt;
&lt;P&gt;PROC SETINIT;&lt;/P&gt;
&lt;P&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should see a line a log that reads SAS/OR, otherwise, you haven't it licensed.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Oct 2015 19:05:59 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2015-10-26T19:05:59Z</dc:date>
    <item>
      <title>create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231594#M1139</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm working on a data quality problem, and more specifically detecting duplicates with fuzzy logic using COMPGED and COMPLEV functions based on &amp;nbsp;&lt;A href="http://www.lexjansen.com/nesug/nesug07/ap/ap23.pdf" target="_blank"&gt;this paper&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have detected duplicates, but per couple.&lt;BR /&gt;example:&lt;BR /&gt;assuming that customers with customer_id equals 01, 02 and 03 reference the same customer (let's call him John), my SAS program detects it this way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;row_num | duplicate_id&amp;nbsp;&lt;BR /&gt;1 | 01-02&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="line-height: 20px;"&gt;2&lt;/SPAN&gt; | 01-03&amp;nbsp;&lt;BR /&gt;3 | 02-03&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;where duplicate_id is an id that I've created combining both customer ids to reference a couple of duplicates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what I want now is to have a unique id for John !&lt;/P&gt;&lt;P&gt;The final result that I want is :&lt;BR /&gt;duplicate_id&lt;SPAN&gt; | &lt;/SPAN&gt;unique_id&lt;BR /&gt;01-02&amp;nbsp;&lt;SPAN&gt;| &lt;/SPAN&gt;01&lt;BR /&gt;01-03&lt;SPAN&gt;&amp;nbsp;| &lt;/SPAN&gt;01&lt;BR /&gt;02-03&lt;SPAN&gt;&amp;nbsp;| &lt;/SPAN&gt;01&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had the idea to use undirected graph (Operational Research algorithm) but I'm not sure I&amp;nbsp;have the licence for it, and I'm not sure if I can associate&amp;nbsp;a new id even if it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the first example in&amp;nbsp;&lt;A href="http://analytics.ncsu.edu/sesug/2014/AD-08.pdf" target="_blank"&gt;this paper&lt;/A&gt;&amp;nbsp;that uses hash objects&amp;nbsp;can be a first step to find the solution, but the expected result is not what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;Any ideas? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 09:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231594#M1139</guid>
      <dc:creator>majdi_ka</dc:creator>
      <dc:date>2015-10-26T09:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231607#M1140</link>
      <description>&lt;P&gt;"(Operational Research algorithm) but I'm not sure I&amp;nbsp;have the licence for it"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Submit&lt;/P&gt;
&lt;P&gt;PROC SETINIT;&lt;/P&gt;
&lt;P&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should see a line a log that reads SAS/OR, otherwise, you haven't it licensed.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 19:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231607#M1140</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-10-26T19:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231658#M1141</link>
      <description>&lt;P&gt;If you don't have the SAS/OR licence, check out this wonderful &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp;article about a way to find connected components without SAS/OR:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-find-all-connected-components-in-a-graph/ta-p/231539" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-find-all-connected-components-in-a-graph/ta-p/231539&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 16:02:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231658#M1141</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-26T16:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231724#M1142</link>
      <description>&lt;P&gt;I don't know about SAS/OR but if you can create a dataset of pairs you can do this in base SAS&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pair;
input pair $;
datalines;
01-02
01-03
02-03
04-05
04-06
05-06
;
run;

data new(drop=pair1 pair2);
	set pair;
	retain unique pair1 pair2;
	if _n_=1 then do; unique=1; pair1=scan(pair,1,"-"); pair2=scan(pair,2,"-"); end;
	else if indexw(translate(pair," ","-"),pair1)&amp;lt;=0 and indexw(translate(pair," ","-"),pair2)&amp;lt;=0 then do; unique=unique+1; pair1=scan(pair,1,"-"); pair2=scan(pair,2,"-"); end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Oct 2015 19:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231724#M1142</guid>
      <dc:creator>ndp</dc:creator>
      <dc:date>2015-10-26T19:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231781#M1143</link>
      <description>&lt;P&gt;Thanks for your answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked and I don't have licence for it..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 09:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231781#M1143</guid>
      <dc:creator>majdi_ka</dc:creator>
      <dc:date>2015-10-27T09:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231796#M1144</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;&amp;nbsp;for the great article !&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I 've tried the example in the article, and it worked ! (there's a "&amp;amp;colon;" to replace with ":" in the macro SubGraphs)&lt;BR /&gt;I've tried it also on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/26546"&gt;@ndp﻿&lt;/a&gt;'s example, adding other ids and it worked !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MK&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 10:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231796#M1144</guid>
      <dc:creator>majdi_ka</dc:creator>
      <dc:date>2015-10-27T10:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231798#M1145</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/26546"&gt;@ndp﻿&lt;/a&gt;&amp;nbsp;for your answer,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It worked for your example, but when adding another observation 07-01 to the data &amp;nbsp;I don't get the same unique id as the others.&lt;/P&gt;
&lt;P&gt;it would work if I added 01-07 instead, and then sorted the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't verify the program&amp;nbsp;with all the prequisites, but it's still a good solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot !&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 11:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231798#M1145</guid>
      <dc:creator>majdi_ka</dc:creator>
      <dc:date>2015-10-27T11:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: create unique id for duplicates referencing the same customer</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231851#M1147</link>
      <description>&lt;P&gt;Thank &lt;U&gt;you&lt;/U&gt; for finding the &lt;EM&gt;&amp;amp;colon;&lt;/EM&gt; problem. I revised the article. Cheers!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 15:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/create-unique-id-for-duplicates-referencing-the-same-customer/m-p/231851#M1147</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-27T15:54:34Z</dc:date>
    </item>
  </channel>
</rss>

