<?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 display the proper label in proc means? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734686#M228857</link>
    <description>&lt;P&gt;Text is limited to 32 characters only &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 10:03:04 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2021-04-16T10:03:04Z</dc:date>
    <item>
      <title>How to display the proper label in proc means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734661#M228843</link>
      <description>&lt;P&gt;Hi all SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Today I use the PROC MEANS and label statement to make the report more aesthetic&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods noproctitle;
title 'Summary statistics align with previous papers';
footnote '16th, April,2021';

proc means data= merge_treat_con n nmiss mean median std min max;
var TOT_ASS wROA;
label TOT_ASS=Total Assets($)
wROA=Return on Assets
;
run;

title;footnote;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result is as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_0-1618549465574.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58106i58F2161AD73D26F9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_0-1618549465574.png" alt="Phil_NZ_0-1618549465574.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What I want to focus on are two columns: Variable and Label. Now I want to delete the Column Variable and rename the column Label to Variable&lt;/P&gt;
&lt;P&gt;Like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Variable
Total Assets($)
Return on Assets&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I know in other datastep we can use option or statement drop or rename but they seem not to work in proc mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please help me to sort it out?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 09:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734661#M228843</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-04-16T09:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the proper label in proc means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734670#M228848</link>
      <description>&lt;P&gt;Maybe this not elegant one with validvarname=ANY:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data merge_treat_con; 
input TOT_ASS wROA;
cards;
1 2
3 4
5 6
7 8
;
run;

ods noproctitle;
OPTIONS VALIDVARNAME=ANY;
title 'Summary statistics align with previous papers';
footnote '16th, April,2021';
proc means data= merge_treat_con(rename=
(
TOT_ASS="Total Assets($)"n
wROA   ="Return on Assets"n
)
) n nmiss mean median std min max;
var "Total Assets($)"n "Return on Assets"n;
run;
title;
footnote;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 07:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734670#M228848</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-04-16T07:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the proper label in proc means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734673#M228851</link>
      <description>&lt;P&gt;Other approach:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data merge_treat_con; 
input TOT_ASS wROA;
cards;
1 2
3 4
5 6
7 8
;
run;

ODS HTML CLOSE;

ods noproctitle;
/*ods trace on;*/
ods output summary = stacked;
proc means data= merge_treat_con n nmiss mean median std min max 
STACKODSOUTPUT;
var TOT_ASS wROA;
run;
/*ods trace off;*/

proc format;
value $ myLab
  TOT_ASS="Total Assets($)"
  wROA   ="Return on Assets"
;
run;

ods html;
title 'Summary statistics align with previous papers';
footnote '16th, April,2021';
proc print data = stacked;
  format variable $myLab.;
run;
title;
footnote;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 08:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734673#M228851</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-04-16T08:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the proper label in proc means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734681#M228854</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your solution, when I run your code, the error happening as below, can you please help me to sort it out?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Writing HTML Body file: sashtml33.htm
ERROR: Insufficient authorization to access C:\WINDOWS\system32\sashtml33.htm.
ERROR: No body file. HTML output will not be created.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The whole log&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;34         data merge_treat_conz;
35         input TOT_ASS wROA;
36         cards;

NOTE: The data set WORK.MERGE_TREAT_CONZ has 4 observations and 2 variables.
NOTE: Compressing data set WORK.MERGE_TREAT_CONZ decreased size by 0.00 percent. 
      Compressed is 1 pages; un-compressed would require 1 pages.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

41         ;
42         run;
43         
44         ODS HTML CLOSE;
45         
46         ods noproctitle;
47         /*ods trace on;*/
48         ods output summary = stacked;
49         proc means data= merge_treat_conz n nmiss mean median std min max
50         STACKODSOUTPUT;
51         var TOT_ASS wROA;
52         run;

NOTE: The data set WORK.STACKED has 2 observations and 8 variables.
NOTE: Compressing data set WORK.STACKED decreased size by 0.00 percent. 
      Compressed is 1 pages; un-compressed would require 1 pages.
NOTE: There were 4 observations read from the data set WORK.MERGE_TREAT_CONZ.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      

53         /*ods trace off;*/
54         
55         proc format;
56         value $ myLab
57           TOT_ASS="Total Assets($)"
58           wROA   ="Return on Assets"
59         ;
NOTE: Format $MYLAB is already on the library WORK.FORMATS.
NOTE: Format $MYLAB has been output.
60         run;

NOTE: PROCEDURE FORMAT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

61         
62         ods html;
NOTE: Writing HTML Body file: sashtml33.htm
ERROR: Insufficient authorization to access C:\WINDOWS\system32\sashtml33.htm.
ERROR: No body file. HTML output will not be created.
2                                                          The SAS System                              19:20 Tuesday, April 13, 2021

63         title 'Summary statistics align with previous papers';
64         footnote '16th, April,2021';
65         proc print data = stacked;
66           format variable $myLab.;
67         run;

NOTE: Access by observation number not available. Observation numbers will be counted by PROC PRINT.
NOTE: There were 2 observations read from the data set WORK.STACKED.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Warm regards.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 09:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734681#M228854</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-04-16T09:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the proper label in proc means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734683#M228855</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run and it goes well, I am wondering why you say it is not elegant then?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_0-1618565716835.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58112i8D7A270DE76281E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_0-1618565716835.png" alt="Phil_NZ_0-1618565716835.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 09:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734683#M228855</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-04-16T09:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the proper label in proc means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734686#M228857</link>
      <description>&lt;P&gt;Text is limited to 32 characters only &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 10:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734686#M228857</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-04-16T10:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the proper label in proc means?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734689#M228858</link>
      <description>&lt;P&gt;Try adding:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put *%sysfunc(DLGCDIR(%sysfunc(pathname(WORK))))*;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before `ods html;` and let me know if it helped.&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>Fri, 16 Apr 2021 10:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-display-the-proper-label-in-proc-means/m-p/734689#M228858</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-04-16T10:06:31Z</dc:date>
    </item>
  </channel>
</rss>

