<?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 Change the Column Order in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282670#M57475</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an imported dataset (from a text file) and added only one column to the table / dataset called "Data_Source".&amp;nbsp; The position of the added column is &lt;STRONG&gt;Last&lt;/STRONG&gt;.&amp;nbsp; How can I move it to F&lt;STRONG&gt;irst&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Columns Order IS:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp; D&amp;nbsp;&amp;nbsp; Data_Source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Column Order Desired:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Data_Source&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp; D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2016 12:52:01 GMT</pubDate>
    <dc:creator>Kody_devl</dc:creator>
    <dc:date>2016-07-07T12:52:01Z</dc:date>
    <item>
      <title>Change the Column Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282670#M57475</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an imported dataset (from a text file) and added only one column to the table / dataset called "Data_Source".&amp;nbsp; The position of the added column is &lt;STRONG&gt;Last&lt;/STRONG&gt;.&amp;nbsp; How can I move it to F&lt;STRONG&gt;irst&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Columns Order IS:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp; D&amp;nbsp;&amp;nbsp; Data_Source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Column Order Desired:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Data_Source&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp; D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 12:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282670#M57475</guid>
      <dc:creator>Kody_devl</dc:creator>
      <dc:date>2016-07-07T12:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Column Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282672#M57476</link>
      <description>&lt;P&gt;hEllo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how have you added the column ? If you have used a data step than you can put it in the first position by simply naming it before the set statement. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;

length a $ 15;

set sashelp.class;

a='z'||name;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jul 2016 12:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282672#M57476</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-07-07T12:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Column Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282683#M57479</link>
      <description>&lt;P&gt;Here is my code to add the new column, not in the text file that was imported.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/* Add Field */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;alter table work.Loan_Detail_&amp;amp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;i.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;add Data_Source CHAR(&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;35&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 14:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282683#M57479</guid>
      <dc:creator>Kody_devl</dc:creator>
      <dc:date>2016-07-07T14:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Column Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282697#M57484</link>
      <description>There have been quite a few threads with this topic on the communities, pls do a search. &lt;BR /&gt;Question is, why bother about column order? Leave that to the reporting part.</description>
      <pubDate>Thu, 07 Jul 2016 14:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/282697#M57484</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-07-07T14:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Column Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/284008#M57933</link>
      <description>&lt;P&gt;I found some code that works.&amp;nbsp;&amp;nbsp; Not sure how it works but it move my columns to the front.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Change Order of Fields*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; work.ALL_MONTHS_LOAN_DETAIL;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;retain&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; Source_Date Data_Source;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; ALL_MONTHS_LOAN_DETAIL;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 12:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/284008#M57933</guid>
      <dc:creator>Kody_devl</dc:creator>
      <dc:date>2016-07-13T12:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Column Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/284141#M57966</link>
      <description>That will force a table rewrite, but isn't a problem if it's small. &lt;BR /&gt;Another option is to keep an empty template table, with your preferred column order, labels, formats etc. Then append your incoming data to that table.</description>
      <pubDate>Wed, 13 Jul 2016 17:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Column-Order/m-p/284141#M57966</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-07-13T17:56:46Z</dc:date>
    </item>
  </channel>
</rss>

