<?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 sort second letter in a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sort-second-letter-in-a-string/m-p/626612#M184853</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table t as 
select * from sashelp.class
order by substr(Name,2);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;i want to get output second letter in ascending order in a string using data step&lt;/P&gt;</description>
    <pubDate>Sat, 22 Feb 2020 06:52:20 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2020-02-22T06:52:20Z</dc:date>
    <item>
      <title>sort second letter in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sort-second-letter-in-a-string/m-p/626612#M184853</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table t as 
select * from sashelp.class
order by substr(Name,2);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;i want to get output second letter in ascending order in a string using data step&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 06:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sort-second-letter-in-a-string/m-p/626612#M184853</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-02-22T06:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: sort second letter in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sort-second-letter-in-a-string/m-p/626614#M184854</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an approach to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t_temp;
	set sashelp.class;
	second_letter = substr(Name,2);
run;

proc sort data=t_temp out=t (drop=second_letter);
	by second_letter;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Feb 2020 07:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sort-second-letter-in-a-string/m-p/626614#M184854</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-22T07:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: sort second letter in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sort-second-letter-in-a-string/m-p/626615#M184855</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach could be the following one, using a hash object:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	if _n_=1 then do;
		declare hash h(ordered:'a');
		h.definekey('second_letter');
		h.definedata('Name','Sex','Age','Height','Weight');
		h.definedone();
	end;
	set sashelp.class;
	second_letter = substr(Name,2);
	h.add();
	h.output(dataset:'t');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Feb 2020 07:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sort-second-letter-in-a-string/m-p/626615#M184855</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-22T07:55:13Z</dc:date>
    </item>
  </channel>
</rss>

