<?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: Data Manipulating Sorting in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455815#M115366</link>
    <description>&lt;P&gt;Try next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
input A $ B $  C $;
array v $ A B C;
call sortc(v);
a = v(1);
b = v(2);
c = v(3);
length D $11;
D = catx(',',A,B,C);
cards;
801 905 823
903 801 803
905 801 823
823 801  .
823 905 801
801 823 
;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, 20 Apr 2018 03:27:09 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2018-04-20T03:27:09Z</dc:date>
    <item>
      <title>Data Manipulating Sorting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455811#M115364</link>
      <description>&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;I have 3 columns of 3-digit data with about 30k rows. I want to concatenate and put commas between them to make a single character variable and use PROC FREQ to get the count of each of the similar combinations. The problem is I want to treat, say ABC is same as ACB, or BAC, etc. (all 6 possible combination same) as same entry and if all 6 combinations are present in the data then PROC FREQ should yield ABC with freq count 6. Also, if there are only two A and B the treat AB and BA same. The data looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA HAVE;&lt;/P&gt;&lt;P&gt;input A B C;&lt;/P&gt;&lt;P&gt;D= CATT(of A, B, C);&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;801 905 823&lt;/P&gt;&lt;P&gt;903 801 803&lt;/P&gt;&lt;P&gt;905 801 823&lt;/P&gt;&lt;P&gt;823 801&amp;nbsp; .&lt;/P&gt;&lt;P&gt;823 905 801&lt;/P&gt;&lt;P&gt;801 823 .&lt;/P&gt;&lt;P&gt;...;&lt;/P&gt;&lt;P&gt;Now D will have 1st, 3rd, and 5th row will have (801,905,823), (905,801,823) and (823,905,801), I would like PROC FREQ to yield (801, 823, 905) with frequency 3, And, similarly from 4th and 6th row (801,823) with frequency 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will appreciate any suggestions.&lt;/P&gt;&lt;P&gt;Thank you all.&lt;/P&gt;&lt;P&gt;Sijansap&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 02:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455811#M115364</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2018-04-20T02:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Data Manipulating Sorting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455815#M115366</link>
      <description>&lt;P&gt;Try next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
input A $ B $  C $;
array v $ A B C;
call sortc(v);
a = v(1);
b = v(2);
c = v(3);
length D $11;
D = catx(',',A,B,C);
cards;
801 905 823
903 801 803
905 801 823
823 801  .
823 905 801
801 823 
;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, 20 Apr 2018 03:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455815#M115366</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-20T03:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data Manipulating Sorting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455817#M115368</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  input A B C;
  call sortn(A,B,C);
  D= catx(',', A, B, C);
cards;
801 905 823
903 801 803
905 801 823
823 801  .
823 905 801
801 823 .
run;
proc freq; 
  table D; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Freq: One-Way Frequencies" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;D&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Percent&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Percent&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;.,801,823&lt;/TH&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;33.33&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;33.33&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;801,803,903&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;16.67&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="r data"&gt;50.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;801,823,905&lt;/TH&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="r data"&gt;50.00&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="r data"&gt;100.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 20 Apr 2018 03:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455817#M115368</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-20T03:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Data Manipulating Sorting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455821#M115371</link>
      <description>Thank you ChrisNZ. This works great! I appreciate your help.&lt;BR /&gt;-Sijansap</description>
      <pubDate>Fri, 20 Apr 2018 03:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455821#M115371</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2018-04-20T03:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Data Manipulating Sorting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455822#M115372</link>
      <description>Thank you very much Shmuel.&lt;BR /&gt;That is exactly what I wanted.</description>
      <pubDate>Fri, 20 Apr 2018 03:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Manipulating-Sorting/m-p/455822#M115372</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2018-04-20T03:48:16Z</dc:date>
    </item>
  </channel>
</rss>

