<?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: label order in output in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60284#M17091</link>
    <description>tinc&lt;BR /&gt;
 &lt;BR /&gt;
there are many ways to re-order columns&lt;BR /&gt;
possibly there are more ways than programmers&lt;BR /&gt;
here is a simple 1&lt;BR /&gt;
data reordered ;&lt;BR /&gt;
  retain GH DK SV AF ;&lt;BR /&gt;
  set original ;&lt;BR /&gt;
run;&lt;BR /&gt;
If you don't need or want to avoid the second copy of the information, make the first line&lt;BR /&gt;
data reordered /view= reordered ;&lt;BR /&gt;
Then reordered is a view which when referred will return the columns in your GH DK SV AF order.&lt;BR /&gt;
But before going away with this answer, please respond to Cynthia's questions - her responses may just be far more illuminating.&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
    <pubDate>Fri, 07 Jan 2011 17:49:48 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2011-01-07T17:49:48Z</dc:date>
    <item>
      <title>label order in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60282#M17089</link>
      <description>Hi, hope you can help:&lt;BR /&gt;
&lt;BR /&gt;
Trying to find out if it’s possible to reorder the output labels from sas E.g. the output I get out at the mo would be (these are just examples, not real variables etc):&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
.....AF    GH     SV      DK&lt;BR /&gt;
&lt;BR /&gt;
GH   xx     xx       xx      xx&lt;BR /&gt;
&lt;BR /&gt;
DK   xx     xx       xx      xx  &lt;BR /&gt;
&lt;BR /&gt;
SV   xx     xx       xx      xx &lt;BR /&gt;
&lt;BR /&gt;
AF   xx     xx       xx      xx&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
But I need:&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
....GH    DK     SV      AF&lt;BR /&gt;
&lt;BR /&gt;
DK   xx     xx       xx      xx&lt;BR /&gt;
&lt;BR /&gt;
SV   xx     xx       xx      xx  &lt;BR /&gt;
&lt;BR /&gt;
GH   xx     xx       xx      xx &lt;BR /&gt;
&lt;BR /&gt;
AF   xx     xx       xx      xx&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
Because that’s how it’s presented in our publications. It’s not a big deal, but just means I spend time faffing moving columns around in excel when I sure it could just output it like this straight away. The labels are ones I have defined in proc formats.&lt;BR /&gt;
&lt;BR /&gt;
would be a massive help if it is possible but not a huge problem if it isn't.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance</description>
      <pubDate>Fri, 07 Jan 2011 15:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60282#M17089</guid>
      <dc:creator>tinc</dc:creator>
      <dc:date>2011-01-07T15:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: label order in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60283#M17090</link>
      <description>Hi:&lt;BR /&gt;
  Are you using PROC EXPORT to get the data into Excel??? Or are you using ODS to send a report to Excel??? If you are using ODS, then what is your procedure of choice (PROC PRINT, PROC REPORT or PROC TABULATE???).&lt;BR /&gt;
 &lt;BR /&gt;
  Actually, seeing the "real" data and variables would be of more help than seeing fake data...for example, you have the same 'values' going down the rows as you have for the column headers. How are you getting or generating this data??? Knowing a bit more would be helpful.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia.</description>
      <pubDate>Fri, 07 Jan 2011 16:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60283#M17090</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-07T16:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: label order in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60284#M17091</link>
      <description>tinc&lt;BR /&gt;
 &lt;BR /&gt;
there are many ways to re-order columns&lt;BR /&gt;
possibly there are more ways than programmers&lt;BR /&gt;
here is a simple 1&lt;BR /&gt;
data reordered ;&lt;BR /&gt;
  retain GH DK SV AF ;&lt;BR /&gt;
  set original ;&lt;BR /&gt;
run;&lt;BR /&gt;
If you don't need or want to avoid the second copy of the information, make the first line&lt;BR /&gt;
data reordered /view= reordered ;&lt;BR /&gt;
Then reordered is a view which when referred will return the columns in your GH DK SV AF order.&lt;BR /&gt;
But before going away with this answer, please respond to Cynthia's questions - her responses may just be far more illuminating.&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Fri, 07 Jan 2011 17:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60284#M17091</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-01-07T17:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: label order in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60285#M17092</link>
      <description>Hi.&lt;BR /&gt;
Are you to try to use ' notsorted' option in proc format for customizing order of value.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
value fmt(notsorted)&lt;BR /&gt;
  1,2 = 'GH'&lt;BR /&gt;
  3,4 ='DK'&lt;BR /&gt;
  5,6='SV'&lt;BR /&gt;
  7,8='AF'&lt;BR /&gt;
  ;&lt;BR /&gt;
value _fmt(notsorted)&lt;BR /&gt;
  1,2 = 'DK'&lt;BR /&gt;
  3,4 ='SV'&lt;BR /&gt;
  5,6='GH'&lt;BR /&gt;
  7,8='AF'&lt;BR /&gt;
  ;&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
 input a b;&lt;BR /&gt;
 format a _fmt.;&lt;BR /&gt;
format b fmt.;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 5&lt;BR /&gt;
2 8&lt;BR /&gt;
3 6&lt;BR /&gt;
2 1&lt;BR /&gt;
8 3&lt;BR /&gt;
7 2&lt;BR /&gt;
6 4&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc tabulate data=temp;&lt;BR /&gt;
class a b;&lt;BR /&gt;
table a,b;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Mon, 10 Jan 2011 02:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-order-in-output/m-p/60285#M17092</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-01-10T02:47:19Z</dc:date>
    </item>
  </channel>
</rss>

