<?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 mean output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983659#M379539</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;My code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data=bdd vardef=N mean std var cv median max min q1 q3 maxdec=5;
	output out=sumstat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do not have cv, q1 ,q3 and median in table&amp;nbsp;&lt;CODE class=" language-sas"&gt;sumstat.&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Once upon a time in SAS there were two procedures Means and Summary. Means sent results to the default output device such as screen or printer. Proc summary sent output to data sets. And the two were separate. At some point the procedures were merged in proc means somewhat. So the default statistics on the procedure statement remain as the statistics sent to the default output screen but those do not affect the default behavior of the output statement which was brought in from proc summary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And don't forget that there are options now that will make output data sets with the ODS OUTPUT statement that will appear in a different form than the Output statement and can have a different structure using the STACKODSOUTPUT option.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Feb 2026 23:41:35 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2026-02-17T23:41:35Z</dc:date>
    <item>
      <title>Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983593#M379520</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering why in proc means output out I have only a few default stats :&amp;nbsp;N&lt;BR /&gt;MIN&lt;BR /&gt;MAX&lt;BR /&gt;MEAN&lt;BR /&gt;STD ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 08:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983593#M379520</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-02-17T08:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983595#M379522</link>
      <description>&lt;P&gt;Use&amp;nbsp;&lt;A title="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_self"&gt;Maxim 1.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;N,&amp;nbsp;MIN,&amp;nbsp;MAX,&amp;nbsp;MEAN,&amp;nbsp;STD are default.&lt;/P&gt;
&lt;P&gt;Red doc:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p04vbvpcjg2vrjn1v8wyf0daypfi.htm#n031c5tyt5zzfgn1l5gvaw9iobz6" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p04vbvpcjg2vrjn1v8wyf0daypfi.htm#n031c5tyt5zzfgn1l5gvaw9iobz6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;to how to change them.&lt;/P&gt;
&lt;P&gt;Check the examples too, e.g.,&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n01kt03q5ggzgkn18we7i8i9ixie.htm#n01kt03q5ggzgkn18we7i8i9ixie" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n01kt03q5ggzgkn18we7i8i9ixie.htm#n01kt03q5ggzgkn18we7i8i9ixie&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 10:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983595#M379522</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2026-02-17T10:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983598#M379524</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need (a lot) more statistics &lt;EM&gt;by default&lt;/EM&gt;, use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_univariate_toc.htm" target="_blank" rel="noopener"&gt;PROC UNIVARIATE&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For an &lt;EM&gt;individual&lt;/EM&gt; selection of statistics that you need regularly, you could define one or more lists of statistics keywords in macro variables and use them with PROC MEANS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mystats=n mean cv clm qrange min q1 median q3 max;

proc means data=sashelp.class &amp;amp;mystats;
var height;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You may want to add the %LET statement to your &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/p0bmj7wjme32ayn1h4wim7trkhp6.htm#p0ceb6r7y2mkdsn1lc2ice1mx1dc" target="_blank" rel="noopener"&gt;autoexec file&lt;/A&gt;, so that the definition of MYSTATS is automatically available in every SAS session.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 10:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983598#M379524</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2026-02-17T10:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983603#M379526</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;My code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data=bdd vardef=N mean std var cv median max min q1 q3 maxdec=5;
	output out=sumstat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do not have cv, q1 ,q3 and median in table&amp;nbsp;&lt;CODE class=" language-sas"&gt;sumstat.&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 11:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983603#M379526</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-02-17T11:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983606#M379528</link>
      <description>&lt;P&gt;If you want statistics other than the default in the output data set, you need to explicitly name them as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=bdd vardef=N mean std var cv median max min q1 q3 maxdec=5;
	output out=sumstat mean= std= var= cv=median= max= min= q1= q3= / autoname;
run;

proc print data=sumstat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To reshape the output data set, consider the following:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/42/381.html" target="_self"&gt;http://support.sas.com/kb/42/381.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/" target="_self"&gt;https://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 11:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983606#M379528</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2026-02-17T11:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983612#M379529</link>
      <description>&lt;P&gt;1) You could use the following code to get the statistical estimators as you need.&lt;/P&gt;
&lt;PRE&gt;proc summary data=sashelp.class nway;
class sex;
var weight;
output out=want &lt;STRONG&gt;min= max= cv= median=/autoname&lt;/STRONG&gt;;
run;&lt;/PRE&gt;
&lt;P&gt;2)You could use PROC UNIVARIATE to get all these stats once for all.&lt;/P&gt;
&lt;PRE&gt;proc univariate data=sashelp.class &lt;STRONG&gt;outtable=want2&lt;/STRONG&gt; noprint;
class sex;
var weight;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Feb 2026 14:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983612#M379529</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-02-17T14:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983613#M379530</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;don't cheat &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You didn't read to the doc. in the link I've shared... If you did, you would knew that you should provide statistical keywords in the OUTPUT statement of MEANS Procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at the snippet shared by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13770"&gt;@Kathryn_SAS&lt;/a&gt;, it will guide you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 14:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983613#M379530</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2026-02-17T14:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983614#M379531</link>
      <description>Thank you, Kathryn!</description>
      <pubDate>Tue, 17 Feb 2026 14:54:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983614#M379531</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-02-17T14:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc mean output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983659#M379539</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;My code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data=bdd vardef=N mean std var cv median max min q1 q3 maxdec=5;
	output out=sumstat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do not have cv, q1 ,q3 and median in table&amp;nbsp;&lt;CODE class=" language-sas"&gt;sumstat.&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Once upon a time in SAS there were two procedures Means and Summary. Means sent results to the default output device such as screen or printer. Proc summary sent output to data sets. And the two were separate. At some point the procedures were merged in proc means somewhat. So the default statistics on the procedure statement remain as the statistics sent to the default output screen but those do not affect the default behavior of the output statement which was brought in from proc summary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And don't forget that there are options now that will make output data sets with the ODS OUTPUT statement that will appear in a different form than the Output statement and can have a different structure using the STACKODSOUTPUT option.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 23:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-mean-output/m-p/983659#M379539</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2026-02-17T23:41:35Z</dc:date>
    </item>
  </channel>
</rss>

