<?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: Proc sort in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955132#M373020</link>
    <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/390518"&gt;@pavank&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;the Article "How to sort data in SAS" by &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;Andy Rav (&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-sort-data-in-SAS/ta-p/676170" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-sort-data-in-SAS/ta-p/676170)&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;&amp;nbsp;which also recommen&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;ds &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Chris Hemedingers blog (&lt;STRONG&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2016/02/04/avoid-sorting-data-in-sas/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2016/02/04/avoid-sorting-data-in-sas/)&lt;/A&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;should be a good starting point for our question.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Best Regards&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Markus&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 05 Jan 2025 07:03:06 GMT</pubDate>
    <dc:creator>MarkusWeick</dc:creator>
    <dc:date>2025-01-05T07:03:06Z</dc:date>
    <item>
      <title>Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955131#M373019</link>
      <description>What are disadvantages of Proc sort precedure  give some points  which is best method for sorting data and delete duplicates data even if huge data and small data</description>
      <pubDate>Sun, 05 Jan 2025 05:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955131#M373019</guid>
      <dc:creator>pavank</dc:creator>
      <dc:date>2025-01-05T05:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955132#M373020</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/390518"&gt;@pavank&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;the Article "How to sort data in SAS" by &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;Andy Rav (&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-sort-data-in-SAS/ta-p/676170" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-sort-data-in-SAS/ta-p/676170)&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;&amp;nbsp;which also recommen&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-SAS-Employee"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link" aria-disabled="true"&gt;&lt;SPAN class=""&gt;ds &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Chris Hemedingers blog (&lt;STRONG&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2016/02/04/avoid-sorting-data-in-sas/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2016/02/04/avoid-sorting-data-in-sas/)&lt;/A&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;should be a good starting point for our question.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Best Regards&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Markus&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2025 07:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955132#M373020</guid>
      <dc:creator>MarkusWeick</dc:creator>
      <dc:date>2025-01-05T07:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955133#M373021</link>
      <description>&lt;P&gt;PROC SORT is not good/efficient for BIG table.&lt;/P&gt;
&lt;P&gt;Here is the best&amp;nbsp; way to sort BIG table:&lt;/P&gt;
&lt;P&gt;p.s. WANT table is what you are looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dsn= sashelp.heart ;
%let var= Smoking_Status ;






/***********************/
%let dsid=%sysfunc(open(&amp;amp;dsn.));
%let vnum=%sysfunc(varnum(&amp;amp;dsid.,&amp;amp;var.));
%let vtype=%sysfunc(vartype(&amp;amp;dsid.,&amp;amp;vnum.));
%let dsid=%sysfunc(close(&amp;amp;dsid.));
proc sql;
create table _levels as
select distinct &amp;amp;var. as levels from &amp;amp;dsn.;
quit;
data _levels;
 set _levels;
 n+1;vtype="&amp;amp;vtype.";
run;
filename x temp;
data _null_;
file x;
put 'data ';
do until(last1);
 set _levels end=last1;
 put '_' n;
end;
put ";set &amp;amp;dsn.;select(&amp;amp;var.);";
do until(last2);
 set _levels end=last2;
 if upcase(vtype)='C' then put 'when("' levels +(-1) '") output _' n ';';
  else put 'when(' levels ') output _' n ';';
end;
put 'otherwise;end;run; data want;set ';
do until(last3);
 set _levels end=last3;
 put '_' n;
end;
put ';run;';
stop;
run;
%include x;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Jan 2025 07:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955133#M373021</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-05T07:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955134#M373022</link>
      <description>&lt;P&gt;Some things to consider other than the size of the data set:&lt;/P&gt;
&lt;P&gt;What kind of values are in the BY variables? Some of&amp;nbsp; the options available in SORTSEQ, such as LINGUISTIC and/or NUMERIC_COLLATION may make Proc sort preferred over some simpler approaches because the desired result order may be attainable using them but not in other tools.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example with the NUMERIC_COLLATION you can get text values that include characters to include the numeric value of the numerals and not the character coding only. This means for example that in sorting street addresses where you have a name and number that you get&lt;/P&gt;
&lt;P&gt;11&amp;nbsp; Main St&lt;/P&gt;
&lt;P&gt;45 Main St&lt;/P&gt;
&lt;P&gt;123 Main St&lt;/P&gt;
&lt;P&gt;145 Main St&lt;/P&gt;
&lt;P&gt;1150 Main St&lt;/P&gt;
&lt;P&gt;in that order instead of&lt;/P&gt;
&lt;P&gt;11 Main st&lt;/P&gt;
&lt;P&gt;1150 Main St&lt;/P&gt;
&lt;P&gt;123 Main St&lt;/P&gt;
&lt;P&gt;145 Main St&lt;/P&gt;
&lt;P&gt;45 Main St&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2025 08:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955134#M373022</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-01-05T08:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955159#M373042</link>
      <description>&lt;P&gt;In my experience, PROC SORT handles MOST sorting requirements both effectively and efficiently and that is its biggest advantage. I suggest you try it for your use case and if it works efficiently then use it. Yes, there are times when huge datasets might require a different approach, but don't assume there are better sort methods for ALL datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, by keeping your data in sorted order you can often avoid a lot of sorting entirely.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2025 19:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955159#M373042</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-01-05T19:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955224#M373068</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, &lt;BR /&gt;Interesting system options for proc sort.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Are those options system specific?&amp;nbsp; Couldn't find clear info in documentation (ref:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/proc/3.2/p02bhn81rn4u64n1b6l00ftdnxge.htm#p0o1lj0p3exoifn1rmqvmdcb82i7" target="_blank"&gt;https://documentation.sas.com/doc/en/proc/3.2/p02bhn81rn4u64n1b6l00ftdnxge.htm#p0o1lj0p3exoifn1rmqvmdcb82i7&lt;/A&gt;).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When I submit the code below this option doesn't work and log has an error message.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
infile cards dlm=','; 
length name $20; 
input name $;
cards; 
11  Main St,
1150 Main St,
45 Main St,
123 Main St,
145 Main St
;
run; 

options sortseq=LINGUISTIC(numeric_collation=on);
proc sort data=have out=foo1;                                          
by name;                                                                        
run;      &lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;442  options sortseq=LINGUISTIC(numeric_collation=on)
                                                    ----------------------
                                                    13
442! ;
ERROR 13-12: Unrecognized SAS option name (NUMERIC_COLLATION=ON).
443  proc sort data=have out=foo1;
444  by name;
445  run;

&lt;/PRE&gt;
&lt;P&gt;I use SAS windowing environment,&amp;nbsp; version: 9.04.01M5P091317&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 16:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955224#M373068</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2025-01-06T16:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955379#M373128</link>
      <description>&lt;P&gt;I will admit that there aren't good examples in the documentation. But the numericl collition option is for PROC SORT, not the OPTIONS statement AFAIK. The SORTSEQ option on the Options statement is basically for Language character set such as the sort order differences for "A" "a" "â" using a specific language. French might sort the "â" differently than Vietnamese for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sort data=have out=foo1 sortseq=LINGUISTIC(numeric_collation=on);                                         
by name;                                                                        
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2025 20:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955379#M373128</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-01-07T20:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955572#M373184</link>
      <description>&lt;P&gt;Excellent, it's helpful knowing sortseq option of proc sort, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 00:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/955572#M373184</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2025-01-09T00:09:08Z</dc:date>
    </item>
  </channel>
</rss>

