<?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 Change variable names in PROC MEANS output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785532#M250707</link>
    <description>&lt;P&gt;Hi all, I have the following code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = work.final;
	by Grades;
run;

proc means data = work.final maxdec = 2 nonobs;
	class Grades;
	var Emotionality;
	output out = FS (drop = _FREQ_) N = mean = std = min = max = / autoname;
run;

proc sort data = work.FS;
	by descending _TYPE_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which gives me a table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-12-11 at 9.35.12 PM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66641i482C144F182C01C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-12-11 at 9.35.12 PM.png" alt="Screen Shot 2021-12-11 at 9.35.12 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm now trying to change the variable names with the following code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data FS(drop = _TYPE_);
	set work.FS;
	label Average_grades_in_school = 'Group' N = 'Count' Mean = 'Average' Std_Dev = 'Standard_Deviation';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And it gives me the same output. Could anyone give me some advice? Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Sat, 11 Dec 2021 13:38:35 GMT</pubDate>
    <dc:creator>aabbccwyt</dc:creator>
    <dc:date>2021-12-11T13:38:35Z</dc:date>
    <item>
      <title>Change variable names in PROC MEANS output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785532#M250707</link>
      <description>&lt;P&gt;Hi all, I have the following code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = work.final;
	by Grades;
run;

proc means data = work.final maxdec = 2 nonobs;
	class Grades;
	var Emotionality;
	output out = FS (drop = _FREQ_) N = mean = std = min = max = / autoname;
run;

proc sort data = work.FS;
	by descending _TYPE_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which gives me a table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-12-11 at 9.35.12 PM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66641i482C144F182C01C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-12-11 at 9.35.12 PM.png" alt="Screen Shot 2021-12-11 at 9.35.12 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm now trying to change the variable names with the following code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data FS(drop = _TYPE_);
	set work.FS;
	label Average_grades_in_school = 'Group' N = 'Count' Mean = 'Average' Std_Dev = 'Standard_Deviation';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And it gives me the same output. Could anyone give me some advice? Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785532#M250707</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2021-12-11T13:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Change variable names in PROC MEANS output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785534#M250708</link>
      <description>&lt;P&gt;You're not changing variable names, you are changing the label on the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having said that, what is your concern here, do you want a table (such as the one you show) showing these labels; or do you want SAS data set with different variable names (as your title implies)?&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;data FS(drop = _TYPE_);
	set work.FS;
	label Average_grades_in_school = 'Group' N = 'Count' Mean = 'Average' Std_Dev = 'Standard_Deviation';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;And it gives me the same output. Could anyone give me some advice? Thank you in advance!&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you're not asking for output ... how are you creating output here? ... please explain.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785534#M250708</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-11T13:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Change variable names in PROC MEANS output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785535#M250709</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Yes. I'm changing the label on the variables, that's what I mean and thank you for the clarification. And I want a table showing these labels. By output, I mean the table itself. I've been up pretty much all night and my head is in a mess. Sorry about that.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785535#M250709</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2021-12-11T14:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change variable names in PROC MEANS output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785544#M250710</link>
      <description>&lt;P&gt;If you want to create an output DATASET instead of the report you pasted the photograph of then just include the name you want for the variables for a statistic after the equal sign that follows the keyword for that statistic&lt;/P&gt;
&lt;P&gt;If you want to produce a printed report from the generated dataset then just use any reporting procedure, like proc print.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data = work.final nway noprint;
  class Grades;
  var Emotionality;
  output out = FS (drop = _FREQ_) 
    N = Count
    mean = Average
    std = StandardDeviation
    min = Minimum
    max = Maximum
  ;
run;

proc print data=fs noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to change the column headings used when printing the dataset into a tabular report you might want to use a LABEL statement in the PROC PRINT step.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785544#M250710</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-11T15:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change variable names in PROC MEANS output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785563#M250718</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=fs label;
var average_grades_in_school n mean std_dev;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you use labels, don't make labels that have underscores where spaces should be. Make the labels look like correct English (or whatever other language you want it to be). The label should not be 'Standard_Deviation' with an underscore as if you were creating labels for the benefit of the computer, it should be 'Standard Deviation' with a space as if you were creating labels for the benefit of people.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-variable-names-in-PROC-MEANS-output/m-p/785563#M250718</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-11T17:00:12Z</dc:date>
    </item>
  </channel>
</rss>

