<?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 Making string in Alphabetical order in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Making-string-in-Alphabetical-order/m-p/75712#M21974</link>
    <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
i am having a string and it shd be in alpha betical order&lt;BR /&gt;
&lt;BR /&gt;
data x;&lt;BR /&gt;
string='zxy cba';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
output the string shd be in 'abc xyz'</description>
    <pubDate>Fri, 27 Feb 2009 11:22:36 GMT</pubDate>
    <dc:creator>R_Win</dc:creator>
    <dc:date>2009-02-27T11:22:36Z</dc:date>
    <item>
      <title>Making string in Alphabetical order</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Making-string-in-Alphabetical-order/m-p/75712#M21974</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
i am having a string and it shd be in alpha betical order&lt;BR /&gt;
&lt;BR /&gt;
data x;&lt;BR /&gt;
string='zxy cba';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
output the string shd be in 'abc xyz'</description>
      <pubDate>Fri, 27 Feb 2009 11:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Making-string-in-Alphabetical-order/m-p/75712#M21974</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-02-27T11:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Making string in Alphabetical order</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Making-string-in-Alphabetical-order/m-p/75713#M21975</link>
      <description>The call routine SORTC() would do what you seem to want, but as I see the string, just REVERSE() is needed this time.&lt;BR /&gt;
The call routine expects to operate on a list variables. The fastest way to split up the string into one char variables would use peekc() and poke(). Less advanced the following uses a 100element array of 1-byte variables.[pre]  length_s = length( string );&lt;BR /&gt;
  array demo(100) $1 ;&lt;BR /&gt;
  do i= 1 to length_s ;&lt;BR /&gt;
     demo(i) = substr( string, i ) ;&lt;BR /&gt;
  end ; &lt;BR /&gt;
  call sortC( of demo(*) ) ;  &lt;BR /&gt;
  do i= 1 to length_s ;&lt;BR /&gt;
     j = i +100 - length_s ;&lt;BR /&gt;
     substr( string, i,1 ) = demo(j) ;&lt;BR /&gt;
  end ; &lt;BR /&gt;
  drop demo: ; [/pre]&lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Fri, 27 Feb 2009 15:32:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Making-string-in-Alphabetical-order/m-p/75713#M21975</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-02-27T15:32:06Z</dc:date>
    </item>
  </channel>
</rss>

