<?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: Eliminate duplicate record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447627#M112501</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
input f1 $ f1_value f2 $ f2_value;
datalines;
a 1 b 2
a 2 b 2
b 2 a 1
run;

data _null_;
if _n_=1 then do;
if 0 then set have;
dcl hash H () ;
   h.definekey  ("f1",'f1_value','f2','f2_value') ;
   h.definedata ("f1",'f1_value','f2','f2_value') ;
   h.definedone () ;
   end;
set have end=last;
h.replace(key:f2,key:f2_value,key:f1,key:fl_value,data:f1,data:f1_value,data:f2,data:f2_value);
if last then h.output(dataset:'want');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Mar 2018 23:27:00 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-03-21T23:27:00Z</dc:date>
    <item>
      <title>Eliminate duplicate record when factor and value mixed up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447608#M112491</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I have the following data where due to the combination setting, record 1 and 3 are the same (a=1 and b=2) vs (b=2 and a=1)&lt;/P&gt;
&lt;P&gt;Is there any way to eliminate 1 of them?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w; 
input f1 $ f1_value f2 $ f2_value;
datalines;
a 1 b 2
a 2 b 2
b 2 a 1
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Solution and More&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This one is easiest to follow:&lt;/P&gt;
&lt;P&gt;*create string and then sortc;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
input f1 $ f1_value f2 $ f2_value f3 $ f3_value;
datalines;
a 1 b 2 c 0
a 2 b 2 c 0
b 2 a 1 c 0
b 9 a 1 c 0
c 0 a 1 b 2
;Run;

Data Temp;
Set Have;
Col1 = Catt(f1, f1_value);
Col2 = Catt(f2, f2_value);
Col3 = Catt(f3, f3_value);
Call Sortc(Col1, Col2, Col3);
Run;

Proc Sort Data = Temp Out = Want (Drop = Col1 Col2 Col3) Nodupkey;
By Col1 Col2 Col3;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings13/376-2013.pdf&amp;nbsp;" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings13/376-2013.pdf&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID Product1 $ Quantity1 Product2 $ Quantity2 Product3 $ Quantity3;
datalines;
1 Printer 10 Com 25 Games 3
3 Games 8 Printer 50 Com 5
9 Printer 1 Games 3 Com 10
7 Printer 1  Com 10 Games 3
2 Games 3 Printer 1 Com 10
;run;
*the last 3 records are the same;

data report_By_product(drop=I J temp_P temp_Q ) ;
set have;
array P(3) $30 Product1- Product3;
array Q(3) Quantity1-Quantity3;
do I=1 to 3;
do J=1 to 3-I;
if not missing(P(J+1)) and P(J) &amp;gt; P(J+1) then do;
*sort product name in ascending order.;
Temp_P = P(J);
P(J)= P(J+1);
P(J+1) = Temp_P; 
Temp_Q=Q(J);
Q(J)= Q(J+1);
Q(J+1) = Temp_Q;
end; end; end;
run; 

proc sort data=have; by id; run;
data concatenation(drop=I Product1- Product3 Quantity1-Quantity3);
set have;
by id;
array P(3) $30 Product1- Product3;
array Q(3) Quantity1-Quantity3;
array sort_By_prod(3) $30 P1-P3;
*array sort_By_Qty(3) $30 Q1-Q3;

do I=1 to 3;
if not missing(P(I)) then do;
sort_By_prod(I)= strip(P(I))||"/"||put(Q(I), Z4.);
*sort_By_Qty(I) = put(Q(I), Z4.)||"/"|| strip(P(I));
end; end;

call sortC(of P1-P3); *sort by product name in ascending order;
*call sortC(of Q3-Q1); *sort by purchase quantity in descending order;
run; 

proc sort data=concatenation out=want nodupkey;
by P1 P2 P3;run;

data want; set want; keep id;

proc sql; create table want
as select * from want as a left join have as b
on a.ID=b.ID; quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length f1 $32 f2 $32; 
input f1 $ f1_value f2 $ f2_value;
datalines;
Q_TS_WDQ_3stage_trd2 1 Q_hroc_breakrg_close20 2
a 2 b 2
Q_hroc_breakrg_close20 2 Q_TS_WDQ_3stage_trd2 1
run;

data _null_;
if _n_=1 then do;
if 0 then set have;
dcl hash H () ;
   h.definekey  ('f1','f1_value','f2','f2_value') ;
   h.definedata ('f1','f1_value','f2','f2_value') ;
   h.definedone () ;
   end;
set have end=last;
rc=h.check(key:f2,key:f2_value,key:f1,key:f1_value);
if rc ne 0 then h.add(key:f1,key:f1_value,key:f2,key:f2_value,data:f1,data:f1_value,data:f2,data:f2_value);
else h.replace(key:f2,key:f2_value,key:f1,key:f1_value,data:f1,data:f1_value,data:f2,data:f2_value);
if last then h.output(dataset:'want');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
input f1 $ f1_value f2 $ f2_value f3 $ f3_value;
datalines;
a 1 b 2 c 0
a 2 b 2 c 0
b 2 a 1 c 0
b 9 a 1 c 0
c 0 a 1 b 2
run;

*note: record: 1 3 5 are the same;

data _null_;
if _n_=1 then do;
if 0 then set have;
dcl hash H () ;
 h.definekey ("f1",'f1_value','f2','f2_value','f3','f3_value') ;
 h.definedata ("f1",'f1_value','f2','f2_value','f3','f3_value') ;
 h.definedone () ;
 end;
set have end=last;
h.replace(key:f2,key:f2_value,key:f1,key:fl_value,key:f3,key:f3_value, data:f1,data:f1_value,data:f2,data:f2_value,data:f3,data:f3_value);
if last then h.output(dataset:'want');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 13:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447608#M112491</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-03-26T13:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447627#M112501</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
input f1 $ f1_value f2 $ f2_value;
datalines;
a 1 b 2
a 2 b 2
b 2 a 1
run;

data _null_;
if _n_=1 then do;
if 0 then set have;
dcl hash H () ;
   h.definekey  ("f1",'f1_value','f2','f2_value') ;
   h.definedata ("f1",'f1_value','f2','f2_value') ;
   h.definedone () ;
   end;
set have end=last;
h.replace(key:f2,key:f2_value,key:f1,key:fl_value,data:f1,data:f1_value,data:f2,data:f2_value);
if last then h.output(dataset:'want');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Mar 2018 23:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447627#M112501</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-03-21T23:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447642#M112504</link>
      <description>&lt;P&gt;OK, I can see I will need to learn hashing some day.&amp;nbsp; Until that day, I would use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;if f1 &amp;gt; f2 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;chardum = f2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;numdum = f2_value;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;f2 = f1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;f2_value = f1_value;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;f1 = chardum;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;f1_value = numdum;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;drop chardum numdum;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=want nodupkey;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;by f1 f1_value f2 f2_value;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 00:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447642#M112504</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-22T00:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447656#M112506</link>
      <description>&lt;P&gt;I am speechless!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This..."whatever it is" is so so amazing!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and it is easy to manipulate!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much, it is an open eye experience.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&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;</description>
      <pubDate>Thu, 22 Mar 2018 02:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447656#M112506</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-03-22T02:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447676#M112508</link>
      <description>&lt;P&gt;There is something to do with the value of variable that make your code not working.&lt;/P&gt;
&lt;P&gt;My sample data with long value in f1 and f2, the code doesn't help to eliminate the duplicate.&lt;/P&gt;
&lt;P&gt;Can you please help me with that?&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*** This have file with long value  --&amp;gt; the code does not work*/&lt;BR /&gt;data have;
length f1 $32 f2 $32; 
input f1 $ f1_value f2 $ f2_value;
datalines;
Q_TS_WDQ_3stage_trd2 1 Q_hroc_breakrg_close20 2
a 2 b 2
Q_hroc_breakrg_close20 2 Q_TS_WDQ_3stage_trd2 1
run;
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have; 
input f1 $ f1_value f2 $ f2_value;
datalines;
a 1 b 2
a 2 b 2
b 2 a 1
run;


data _null_;
if _n_=1 then do;
if 0 then set have;
dcl hash H () ;
   h.definekey  ("f1",'f1_value','f2','f2_value') ;
   h.definedata ("f1",'f1_value','f2','f2_value') ;
   h.definedone () ;
   end;
set have end=last;
h.replace(key:f2,key:f2_value,key:f1,key:fl_value,data:f1,data:f1_value,data:f2,data:f2_value);
if last then h.output(dataset:'want');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Mar 2018 04:09:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447676#M112508</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-03-22T04:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447683#M112511</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49486"&gt;@hhchenfx&lt;/a&gt;&amp;nbsp; It's just past midnight in Chicago and I don't have sas software at home. Let me get back to my college in the morning, test comprehensively and respond at my earliest convenience.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 05:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447683#M112511</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-03-22T05:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record when factor and value mixed up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447746#M112537</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w; 
input f1 $ f1_value f2 $ f2_value;
datalines;
a 1 b 2
a 2 b 2
b 2 a 1
;
run;
data temp;
 set w; 
 call sortc(f1,f2);
 call sortn(f1_value,f2_value);
run;
proc sort data=temp out=want nodupkey;
by _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Mar 2018 12:45:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447746#M112537</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-03-22T12:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record when factor and value mixed up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447796#M112559</link>
      <description>&lt;P&gt;Thanks a lot, Ksharp,&lt;/P&gt;
&lt;P&gt;I try to modify your code to apply to 3 factors but it doesn't work.&lt;/P&gt;
&lt;P&gt;in this sample data, record 1,3,5 are the same.&lt;/P&gt;
&lt;P&gt;Any tips, please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data w; 
input f1 $ f1_value f2 $ f2_value f3 $ f3_value;
datalines;
a 1 b 2 c 0
a 2 b 2 c 0
b 2 a 1 c 0
b 9 a 1 c 0
c 0 a 1 b 2
;run;

data temp;
 set w; 
 call sortc(f1,f2,f3);
 call sortn(f1_value,f2_value,f3_value);
run;
proc sort data=temp out=want nodupkey;
by _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 14:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447796#M112559</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-03-22T14:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447877#M112589</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49486"&gt;@hhchenfx&lt;/a&gt;&amp;nbsp;Apologies for the delay as I was tired and couldn't wake up &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length f1 $32 f2 $32; 
input f1 $ f1_value f2 $ f2_value;
datalines;
Q_TS_WDQ_3stage_trd2 1 Q_hroc_breakrg_close20 2
a 2 b 2
Q_hroc_breakrg_close20 2 Q_TS_WDQ_3stage_trd2 1
run;

data _null_;
if _n_=1 then do;
if 0 then set have;
dcl hash H () ;
   h.definekey  ('f1','f1_value','f2','f2_value') ;
   h.definedata ('f1','f1_value','f2','f2_value') ;
   h.definedone () ;
   end;
set have end=last;
rc=h.check(key:f2,key:f2_value,key:f1,key:f1_value);
if rc ne 0 then h.add(key:f1,key:f1_value,key:f2,key:f2_value,data:f1,data:f1_value,data:f2,data:f2_value);
else h.replace(key:f2,key:f2_value,key:f1,key:f1_value,data:f1,data:f1_value,data:f2,data:f2_value);
if last then h.output(dataset:'want');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Mar 2018 18:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/447877#M112589</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-03-22T18:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448029#M112649</link>
      <description>&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thanks a lot, Novinosrin!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 02:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448029#M112649</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-03-23T02:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record when factor and value mixed up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448145#M112702</link>
      <description>&lt;P&gt;OK. I overlooked the difficulty of this question. Try this one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w; 
input f1 $ f1_value f2 $ f2_value f3 $ f3_value;
datalines;
a 1 b 2 c 0
a 2 b 2 c 0
b 2 a 1 c 0
b 9 a 1 c 0
c 0 a 1 b 2
;run;

data temp;
 set w; 
 array x{*} $ f1 f2 f3;
 array _x{*} f1_value f2_value f3_value;
 do i=1 to dim(x)-1;
   do j=i+1 to dim(x);
    if x{i}&amp;gt;x{j} then do;
      temp=x{i};x{i}=x{j};x{j}=temp;
      temp=_x{i};_x{i}=_x{j};_x{j}=temp;
    end;
   end;
 end;
 drop i j temp;
run;
proc sort data=temp out=want nodupkey;
by _all_;
run;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448145#M112702</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-03-23T13:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record when factor and value mixed up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448205#M112732</link>
      <description>&lt;P&gt;Thank you all a lot for helping me with that problem&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 15:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448205#M112732</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-03-23T15:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Eliminate duplicate record when factor and value mixed up</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448363#M112773</link>
      <description>&lt;P&gt;Piggybacking off of what KSharp posted, the following method should work for you:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
input f1 $ f1_value f2 $ f2_value f3 $ f3_value;
datalines;
a 1 b 2 c 0
a 2 b 2 c 0
b 2 a 1 c 0
b 9 a 1 c 0
c 0 a 1 b 2
;&lt;BR /&gt;Run;

Data Temp;
Set Have;
Col1 = Catt(f1, f1_value);
Col2 = Catt(f2, f2_value);
Col3 = Catt(f3, f3_value);
Call Sortc(Col1, Col2, Col3);
Run;

Proc Sort Data = Temp Out = Want (Drop = Col1 Col2 Col3) Nodupkey;
By Col1 Col2 Col3;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 22:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eliminate-duplicate-record-when-factor-and-value-mixed-up/m-p/448363#M112773</guid>
      <dc:creator>jdwaterman91</dc:creator>
      <dc:date>2018-03-23T22:46:37Z</dc:date>
    </item>
  </channel>
</rss>

