<?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: Rearrange strings to always have the lowest in column1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503105#M32191</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards expandtabs;
input Var1 $  Var2 $ ;
cards;
0100	104428	 
2566	36186	
3	507094	
40156	2566	
588	49	
	

;
run;

data want;
set have;
call sortc(var1, var2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Oct 2018 14:43:08 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-10-10T14:43:08Z</dc:date>
    <item>
      <title>Rearrange strings to always have the lowest in column1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503102#M32190</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following dataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards expandtabs;
input Var1 $  Var2 $ ;
cards;
0100	104428	 
2566	36186	
3	507094	
40156	2566	
588	49	
	

;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to rearrange the strings so the lowest value is always in column1. We need to end up with something like this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile cards expandtabs;
input Var1 $  Var2 $ ;
cards;
0100	104428	 
2566	36186	
3	507094	
2566 40156	
49	588
	

;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any insight welcome&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503102#M32190</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2018-10-10T14:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange strings to always have the lowest in column1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503105#M32191</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards expandtabs;
input Var1 $  Var2 $ ;
cards;
0100	104428	 
2566	36186	
3	507094	
40156	2566	
588	49	
	

;
run;

data want;
set have;
call sortc(var1, var2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503105#M32191</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-10T14:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange strings to always have the lowest in column1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503111#M32192</link>
      <description>&lt;P&gt;Please note that for &lt;EM&gt;strings&lt;/EM&gt;, e.g., '104428' &lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; '3'.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503111#M32192</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-10T14:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange strings to always have the lowest in column1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503113#M32193</link>
      <description>&lt;P&gt;While not in the example above the strings I'm working on will all be length 13 and alphanumeric. They always end with a letter.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503113#M32193</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2018-10-10T14:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange strings to always have the lowest in column1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503124#M32194</link>
      <description>&lt;P&gt;It is always a good idea to post example data that resembles your actual data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, when they always end with a letter, how do you determine what value is larger?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503124#M32194</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-10-10T15:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange strings to always have the lowest in column1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503126#M32195</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;infile cards expandtabs;&lt;BR /&gt;input Var1 $ Var2 $ ;&lt;BR /&gt;cards;&lt;BR /&gt;0100 104428&lt;BR /&gt;2566 36186&lt;BR /&gt;3 507094&lt;BR /&gt;40156 2566&lt;BR /&gt;588 49&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;array arr1[*] _all_;&lt;BR /&gt;array arr2[*] _ALL_;&lt;BR /&gt;do i=1 to dim(arr1);&lt;BR /&gt;do j=1 to dim(arr2);&lt;BR /&gt;if arr1[i]&amp;gt;arr2[j] then var1=arr2[j];&lt;BR /&gt;if arr1[i]&amp;lt;arr2[j] then var2=arr2[j];&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;drop i j;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503126#M32195</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2018-10-10T15:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rearrange strings to always have the lowest in column1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503203#M32203</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It is always a good idea to post example data that resembles your actual data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, when they always end with a letter, how do you determine what value is larger?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For an example is 123N supposed to come before or after 123a?&lt;/P&gt;
&lt;P&gt;Default character comparisons will have all the upper case come before any of the lower case. This may not be an issue if your letters are always all upper or all lower case. If they have mixed case then your order potentially may not be as desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 19:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rearrange-strings-to-always-have-the-lowest-in-column1/m-p/503203#M32203</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-10T19:00:07Z</dc:date>
    </item>
  </channel>
</rss>

