<?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 How to rearrange the columns' order alphabetically in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50357#M13752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The default out= from PROC CONTENTS or perhaps ORDER=IGNORECASE is&amp;nbsp; probably the most pleasing order with regards to enumerated lists.&amp;nbsp; No name fiddling required. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Mar 2012 18:07:29 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2012-03-30T18:07:29Z</dc:date>
    <item>
      <title>How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50351#M13746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any better way to rearrange the variables in alphabetically order?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data ask;&lt;/P&gt;&lt;P&gt;a_555=1;c_666=3;b_111=2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 16:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50351#M13746</guid>
      <dc:creator>George_S</dc:creator>
      <dc:date>2012-03-30T16:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50352#M13747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;hi ... one idea ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a_555=1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c_666=3;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;b_111=2;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select name into :vars separated by ' '&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from dictionary.columns&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;where libname eq 'WORK' and memname eq 'OLD'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;order by name;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;retain &amp;amp;vars;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;set old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 16:30:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50352#M13747</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-03-30T16:30:27Z</dc:date>
    </item>
    <item>
      <title>How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50353#M13748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to hhave a look at this trhead - I needed a similar process for an FSVIEW ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://communities.sas.com/message/102658#102658"&gt;https://communities.sas.com/message/102658#102658&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(works brilliantly BTW).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 16:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50353#M13748</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2012-03-30T16:32:27Z</dc:date>
    </item>
    <item>
      <title>How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50354#M13749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there are enumerated list variables a1-a100 for example I don't think this will order the variables in a pleasing way.&amp;nbsp; There is a PROC SORT option that I can't think of right now that would work but I don't know how or if that can be implement in SQL orderby.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC CONTENS may output the names in the proper order by default I can't remember.&amp;nbsp; There is ORDER= option.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 17:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50354#M13749</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-30T17:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50355#M13750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... correct (as usual), so (I don't know how to use the different sort options within SQL) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;z2=10; a_555=1; c_666=3; z1=9; b_111=2; z100=10; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sql noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;create table vars as&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;select name from dictionary.columns&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;where libname eq 'WORK' and memname eq 'OLD';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sort data=vars sortseq=linguistic(numeric_collation=on);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;by name;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc sql noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;select name into :vars separated by ' ' from vars;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;drop table vars;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;retain &amp;amp;vars;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;set old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="mcePaste" id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;"&gt;﻿&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 17:49:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50355#M13750</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-03-30T17:49:09Z</dc:date>
    </item>
    <item>
      <title>How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50356#M13751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DN: I think you are referring to numeric_collation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=one out=two&lt;/P&gt;&lt;P&gt;sortseq=linguistic (numeric_collation=on);&lt;/P&gt;&lt;P&gt;by bank;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I don't think it is avaiable in proc sql.&amp;nbsp; However, Chang Chung proposed some code in a thread a couple of years ago:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;This sounds like a reasonable approach. Below surely is. IMHO, that is. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/42984#42984" style="outline-style: none; color: #0e66ba;"&gt;Re: Order variables in dataset&lt;/A&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; /* test data */&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; data one;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain a1 a10a a11 a1a a2 .;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; /* prepare an ordered list of vars */&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; %let num = 0123456789;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; %let ordered=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; proc sql noprint;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp; name into :ordered separated by " "&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dictionary.columns&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp; libname="WORK" and memname="ONE"&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by scan(name, 1, "&amp;amp;num")&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , inputn(scan(name, 1, "&amp;amp;num", "k"), "best")&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , scan(name, 2, "&amp;amp;num");&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; /* re-order */&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; data two;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain &amp;amp;ordered;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set one;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; /* check */&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; proc contents data=two order=varnum;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; /* on lst -- in part&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif; min-height: 8pt; height: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;OL style="background-color: #ffffff; font-size: 12px; list-style-position: initial; list-style-image: initial; padding-left: 2.25em; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;LI&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Variable&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp; Len&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; a1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; a1a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; a2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp; a10a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp; a11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 17:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50356#M13751</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-30T17:50:33Z</dc:date>
    </item>
    <item>
      <title>How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50357#M13752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The default out= from PROC CONTENTS or perhaps ORDER=IGNORECASE is&amp;nbsp; probably the most pleasing order with regards to enumerated lists.&amp;nbsp; No name fiddling required. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 18:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50357#M13752</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-30T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50358#M13753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... hmmm, I think that depends ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want all the q_2 vars listed between q_1 and q_10 ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data old;&lt;BR /&gt;retain q_1 q_34 q_2a&amp;nbsp; q_2 q_2x q_10 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTENTS doesn't work, but NUMERIC COLLATION does&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess one has to make a choice&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style=": ; color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style=": ; color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG style="color: #000080; font-family: Lucida Console;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="color: #000080; font-family: Lucida Console;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-family: Lucida Console;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="color: #000080; font-family: Lucida Console;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 18:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50358#M13753</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-03-30T18:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50359#M13754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc contents treats enumerated variables in a "special way" even if some of them are not present.&amp;nbsp; Variables that end in characters are not enumerated variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like you say depends on what you want. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 19:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50359#M13754</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-30T19:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns' order alphabetically</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50360#M13755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;This solution&amp;nbsp; is from Howles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data old;
z2=10; a_555=1; c_666=3; z1=9; b_111=2; z100=10;
run;

 

proc sql noprint;
select name into : list separated by ' ' from dictionary.columns
 where libname eq 'WORK' and memname eq 'OLD'
&amp;nbsp; order by input(compress(name, ,'kd'),best8.);
quit;
%put &amp;amp;list;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Mar 2012 01:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-rearrange-the-columns-order-alphabetically/m-p/50360#M13755</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-03-31T01:59:14Z</dc:date>
    </item>
  </channel>
</rss>

