<?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: PROC MEANS display in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/572004#M75319</link>
    <description>&lt;P&gt;It is interesting. Looks like ORDER= option in PROC REPORT is not working . Try PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select age,sum(weight) as sum
 from sashelp.class
  group by age
   order by 2 desc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Jul 2019 11:40:45 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-07-09T11:40:45Z</dc:date>
    <item>
      <title>PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571495#M75301</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have written this code for a simple proc means&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;proc means data=have SUM stackodsoutput;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;var E F;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;class A B C D;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;run;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and I am getting this&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt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TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I would like is&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;Italy&lt;/TD&gt;&lt;TD&gt;Coffe&lt;/TD&gt;&lt;TD&gt;$10&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;London&lt;/TD&gt;&lt;TD&gt;Milk&lt;/TD&gt;&lt;TD&gt;$100&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Green&lt;/TD&gt;&lt;TD&gt;Yes&lt;/TD&gt;&lt;TD&gt;Ireland&lt;/TD&gt;&lt;TD&gt;Whole Milk&lt;/TD&gt;&lt;TD&gt;$25&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to have the var variables side by side instead of one below the other. Is that possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate your help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 20:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571495#M75301</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-07-05T20:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571496#M75302</link>
      <description>STACKODS affects the tables not the displayed output. I'm not aware of a way to get that output in PROC MEANS but you could use PROC TABULATE or REPORt if you wanted. Or you can pipe your results from PROC MEANS to a table and print that. &lt;BR /&gt;&lt;BR /&gt;It all depends on what you're doing this for and the next steps.</description>
      <pubDate>Fri, 05 Jul 2019 20:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571496#M75302</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-05T20:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571502#M75303</link>
      <description>&lt;P&gt;Thank you! Let me try PROC TABULATE OR PROC REPORT&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 20:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571502#M75303</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-07-05T20:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571566#M75306</link>
      <description>&lt;P&gt;You missed option NWAY ,since you are using CLASS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc means data=have SUM stackodsoutput&amp;nbsp; NWAY;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2019 11:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571566#M75306</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-07-06T11:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571775#M75310</link>
      <description>&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;I have used PROC REPORT to get the table in the format that I wanted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;proc report data=have;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;column A B C D E F;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;define A/group;&lt;/P&gt;&lt;P&gt;define B/group;&lt;/P&gt;&lt;P&gt;define C/group;&lt;/P&gt;&lt;P&gt;define D/group;&lt;/P&gt;&lt;P&gt;define E/analysis sum;&lt;/P&gt;&lt;P&gt;define F/analysis sum;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;run;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;But I would like the E and F variables in the descending order, is there a way to do that.&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571775#M75310</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-07-08T14:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571832#M75311</link>
      <description>I believe there's an ORDER option on the DEFINE statement.</description>
      <pubDate>Mon, 08 Jul 2019 15:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/571832#M75311</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-08T15:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/572004#M75319</link>
      <description>&lt;P&gt;It is interesting. Looks like ORDER= option in PROC REPORT is not working . Try PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select age,sum(weight) as sum
 from sashelp.class
  group by age
   order by 2 desc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 11:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/572004#M75319</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-07-09T11:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MEANS display</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/572036#M75321</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/275285"&gt;@Gladis6680&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you !&lt;/P&gt;
&lt;P&gt;I have used PROC REPORT to get the table in the format that I wanted&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;proc report data=have;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;column A B C D E F;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;define A/group;&lt;/P&gt;
&lt;P&gt;define B/group;&lt;/P&gt;
&lt;P&gt;define C/group;&lt;/P&gt;
&lt;P&gt;define D/group;&lt;/P&gt;
&lt;P&gt;define E/analysis sum;&lt;/P&gt;
&lt;P&gt;define F/analysis sum;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;run;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;But I would like the E and F variables in the descending order, is there a way to do that.&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How can they both be descending?&lt;/P&gt;
&lt;P&gt;Do you mean you want it descending by E and then within the value of E descending by F?&lt;/P&gt;
&lt;P&gt;You probably need to summarize first and then make a report.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary nway data=have ;
 class a b c d;
 var e f ;
 output out=summary sum= ;
run;
proc sort data=summary ;
  by descending e descending f;
run;
proc print data=summary;
  var a b c d e f;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-MEANS-display/m-p/572036#M75321</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-09T13:34:30Z</dc:date>
    </item>
  </channel>
</rss>

