<?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: How to Move Column to the end in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435295#M108132</link>
    <description>&lt;P&gt;You could always concatenate the file twice using drop and keep statements. e.g.:&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table combined as
      select * from have (drop=col61 col62)
      outer union corr
      select * from have (keep=col61 col62)
  ;
 quit;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2018 15:35:15 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2018-02-08T15:35:15Z</dc:date>
    <item>
      <title>How to Move Column to the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435291#M108129</link>
      <description>&lt;P&gt;I have a big report that have 90 columns (I have used proc sql- Combined many datasets finally).&amp;nbsp;&lt;BR /&gt;Is there any way, to move the 60 th and 61st column to the end.&lt;BR /&gt;I don't want to list all the columns in the Select Column. Wanted to move only few columns to the end and rest should stay same.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 15:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435291#M108129</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2018-02-08T15:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Column to the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435294#M108131</link>
      <description>&lt;P&gt;A report containing 90 variables, would be interested in seeing the code which gets that onto an A4 bit of paper.&amp;nbsp; Anyways, not a simple method - order of columns in SAS does not matter you see.&amp;nbsp; What you can do is create a list of all variables except the two you want to move then add those, something like:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  select name 
  into :vlist
  from sashelp.vcolumn
  where name not in ("A","B");
quit;

data want;
  keep=&amp;amp;vlist. A B;
  set yourdata;
run;&lt;/PRE&gt;
&lt;P&gt;However, if your creating one large data from many using select statements, ordering variables at the point would be better rather than moving around at the end.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 15:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435294#M108131</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-08T15:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Column to the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435295#M108132</link>
      <description>&lt;P&gt;You could always concatenate the file twice using drop and keep statements. e.g.:&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table combined as
      select * from have (drop=col61 col62)
      outer union corr
      select * from have (keep=col61 col62)
  ;
 quit;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 15:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435295#M108132</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-02-08T15:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Column to the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435357#M108166</link>
      <description>&lt;P&gt;Thank you for the solution. The 60th column moved to end but with empty columns. Do you know why is the missing data in the column? I tried removing the CORR too.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 17:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435357#M108166</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2018-02-08T17:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Column to the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435366#M108170</link>
      <description>&lt;P&gt;My error! I hadn't tested the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does it have to be using proc sql? If not, the following data step will work:&lt;/P&gt;
&lt;PRE&gt;data have;
  input col5 col61 col4 col12 col62 col63 col112;
  cards;
1 2 3 4 5 6 7
2 3 4 5 6 7 8
;

data combined;
   set have (drop=col61 col62);
   set have (keep=col61 col62);
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 17:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435366#M108170</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-02-08T17:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Column to the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435396#M108179</link>
      <description>&lt;P&gt;Thank you.. I already tried that way and it worked.. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 19:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435396#M108179</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2018-02-08T19:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Move Column to the end</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435397#M108180</link>
      <description>&lt;P&gt;Appreciate your response.. Thank you.. I will try yours and check if its working.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 19:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Move-Column-to-the-end/m-p/435397#M108180</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2018-02-08T19:35:56Z</dc:date>
    </item>
  </channel>
</rss>

