<?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: Changing the Column positions in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50109#M13623</link>
    <description>another reason for changing stored column order (but I deprecate &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ), it enables a user to review or print data in a different order from the stored order default. &lt;BR /&gt;
In SAS Enterprise Guide the displayed order seems always to be the stored order, and in old-SAS (Display Manager in a "fat client"), although ViewTable allows us to rearrange the column order displayed, it provides no facility to save/reuse the alternate display order.&lt;BR /&gt;
In all "clients" I think we (data users and data managers) should more easily be able to separate our data's definition of "display" (a personal or activity based choice) from the definition of its "storage" (as created - so probably defined by, the provider).&lt;BR /&gt;
in the "fat client" I happily &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; use fsview through the SAS explorer, with the most recently used "column display" applied by default, and alternative displays selected via function keys or toolbar icons (or even commands) - from display formulas stored in catalog entries - &lt;B&gt;without having to recreate or reload data&lt;/B&gt;.&lt;BR /&gt;
It seems a hard challenge for SAS Enterprise Guide to beat. - so far ... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
    <pubDate>Mon, 19 Jul 2010 13:08:11 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-07-19T13:08:11Z</dc:date>
    <item>
      <title>Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50100#M13614</link>
      <description>How to Change the Column position in SAS?&lt;BR /&gt;
&lt;BR /&gt;
Suppose 1st column is the Name field then how do i make it the last column?</description>
      <pubDate>Thu, 15 Jul 2010 08:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50100#M13614</guid>
      <dc:creator>Anilsk</dc:creator>
      <dc:date>2010-07-15T08:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50101#M13615</link>
      <description>Column position of variables is based on the order SAS first sees them, you can search and read more about variable order in SAS.&lt;BR /&gt;
&lt;BR /&gt;
One option (probably not the best, but it works) is to read your dataset in and use format statement &lt;U&gt;before&lt;/U&gt; data set mane. Here you can put all variable names in order you want to see them in final dataset (but be careful to use right formats for them not to lose anything).&lt;BR /&gt;
&lt;BR /&gt;
data yourdata;&lt;BR /&gt;
input one $ two  $ three $;&lt;BR /&gt;
datalines ;&lt;BR /&gt;
a b c&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data yourdata;&lt;BR /&gt;
format two three one;&lt;BR /&gt;
set yourdata;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Maybe somebody else can suggest better solution.</description>
      <pubDate>Thu, 15 Jul 2010 09:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50101#M13615</guid>
      <dc:creator>ieva</dc:creator>
      <dc:date>2010-07-15T09:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50102#M13616</link>
      <description>&lt;P&gt;&lt;EM&gt;Editor's Note:&amp;nbsp; Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15202"&gt;@Florent&lt;/a&gt;&amp;nbsp;for providing an answer using PROC SQL.&amp;nbsp; Technical Support also has a Usage Note that shows how to do this using a DATA step: &lt;A href="http://support.sas.com/kb/8/395.html" target="_self"&gt;Usage Note 8395&lt;/A&gt;. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello,&lt;BR /&gt; &lt;BR /&gt; You can change the column positions by using a PROC SQL statement.&lt;BR /&gt; &lt;BR /&gt; e.g:&lt;BR /&gt; &lt;BR /&gt; Proc sql;&lt;BR /&gt; create table as&lt;BR /&gt; select colomn1,&lt;BR /&gt; colomn2,&lt;BR /&gt; ...,&lt;BR /&gt; Name&lt;BR /&gt; from ;&lt;BR /&gt; quit;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; I hope it helps.&lt;BR /&gt; &lt;BR /&gt; Regards,&lt;BR /&gt; Florent&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 17:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50102#M13616</guid>
      <dc:creator>Florent</dc:creator>
      <dc:date>2017-09-07T17:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50103#M13617</link>
      <description>Why is it necessary to change the SAS internal column location for your variable?  With a DATA step approach, a LENGTH, RETAIN or ATTRIB statement, when coded before a SET statement (if one is used), will order SAS variables.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 15 Jul 2010 14:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50103#M13617</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-15T14:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50104#M13618</link>
      <description>One way to do is to use attrib in data step to define table layout.</description>
      <pubDate>Thu, 15 Jul 2010 14:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50104#M13618</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-15T14:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50105#M13619</link>
      <description>Thanks, I found the proc sql step much easier and i was able to change the column position easily.&lt;BR /&gt;
&lt;BR /&gt;
Will read on the attrib options also for the table layout.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again..</description>
      <pubDate>Fri, 16 Jul 2010 04:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50105#M13619</guid>
      <dc:creator>Anilsk</dc:creator>
      <dc:date>2010-07-16T04:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50106#M13620</link>
      <description>Anilsk&lt;BR /&gt;
the easiest way to change the column order, is to create it in the correct order first, then you won't have to change the order afterwards. Advice you have received on setting column order, should be applied when you create the dataset/table.&lt;BR /&gt;
 &lt;BR /&gt;
There are ways to provide alternative column orders for the same table - a SAS file type called a VIEW. &lt;BR /&gt;
but you didn't ask that question, so ... I still recommend just fixing the problem before it occurs.&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Fri, 16 Jul 2010 14:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50106#M13620</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-07-16T14:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50107#M13621</link>
      <description>I still question the need to influence the SAS-internal column, given that the VAR statement and other techniques can be used to control the output side.  And, consider that a future SAS programmer who must support your program may not agree that a tidy column order is so important.&lt;BR /&gt;
&lt;BR /&gt;
So, again -- why is it important to influence the column order, internally within the SAS member?  It has no bearing on performance, compression, or otherwise -- only when using, for example, PROC PRINT without a VAR statement control.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 16 Jul 2010 17:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50107#M13621</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-16T17:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50108#M13622</link>
      <description>I had some SAS code that was creating html tables of SAS datasets and we wanted the output columns to appear in a certain order.  The code was not smart enough to parse PROC CONTENTS output, so we issued a PROC SQL to the SAS dataset in the column order we desired.&lt;BR /&gt;
&lt;BR /&gt;
I could also see wanting the columns in a certain order if using the %DS2CSV macro to create a delimited flat file, which outputs the columns in the order SAS finds them.&lt;BR /&gt;
&lt;BR /&gt;
I agree with Scott for 99.9% of the cases though.</description>
      <pubDate>Fri, 16 Jul 2010 18:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50108#M13622</guid>
      <dc:creator>DavidJ</dc:creator>
      <dc:date>2010-07-16T18:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50109#M13623</link>
      <description>another reason for changing stored column order (but I deprecate &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ), it enables a user to review or print data in a different order from the stored order default. &lt;BR /&gt;
In SAS Enterprise Guide the displayed order seems always to be the stored order, and in old-SAS (Display Manager in a "fat client"), although ViewTable allows us to rearrange the column order displayed, it provides no facility to save/reuse the alternate display order.&lt;BR /&gt;
In all "clients" I think we (data users and data managers) should more easily be able to separate our data's definition of "display" (a personal or activity based choice) from the definition of its "storage" (as created - so probably defined by, the provider).&lt;BR /&gt;
in the "fat client" I happily &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; use fsview through the SAS explorer, with the most recently used "column display" applied by default, and alternative displays selected via function keys or toolbar icons (or even commands) - from display formulas stored in catalog entries - &lt;B&gt;without having to recreate or reload data&lt;/B&gt;.&lt;BR /&gt;
It seems a hard challenge for SAS Enterprise Guide to beat. - so far ... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Mon, 19 Jul 2010 13:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50109#M13623</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-07-19T13:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Column positions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50110#M13624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use Proc Sql to define the position.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 15:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-the-Column-positions-in-SAS/m-p/50110#M13624</guid>
      <dc:creator>PravinMishra</dc:creator>
      <dc:date>2015-04-02T15:42:16Z</dc:date>
    </item>
  </channel>
</rss>

