<?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 for a list of variables start with _ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363682#M86166</link>
    <description>&lt;P&gt;What's wrong with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data=PL(keep=TYPE _:) noprint;
  by TYPE;
  output out=SUM sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 02 Jun 2017 02:56:18 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-06-02T02:56:18Z</dc:date>
    <item>
      <title>Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363667#M86156</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to run a proc means for a list of variables that start with _&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc means data=PL noprint;
	var _:;
	by type;
	output out=PL_sum
	sum= _:;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem is with SUM=_:&lt;/P&gt;
&lt;P&gt;Is there any way to let SAS keep the original name for variable in output file?&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;HC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:15:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363667#M86156</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-06-02T02:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363669#M86158</link>
      <description>&lt;P&gt;1. Check if the ODS tables work better for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. There is the AUTONAME option but it ends up being the variable_statistic type format. It may work for you, but it isn't the original variable name.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363669#M86158</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T02:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363676#M86162</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use that ODS and Transpose to get what I want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, there is a minor issue related to the number format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the TEMP_ file, some numbers are 2 decimal place, some are rounded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anyway to choose the format of the number in the TEMP_File?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods listing close;
ods output summary=TEMP_;
proc means data=PL stackods SUM;
	by Type;
run;
ods output close;
ods listing;
run;

proc transpose data=TEMP_ out=WANT ;
by Type;
var sum;
id variable;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363676#M86162</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-06-02T02:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363677#M86163</link>
      <description>&lt;P&gt;Apply a format to the new variables. Most likely the underlying variables have the decimal values as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually you use STACKODS and don't transpose or don't use STACKODS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did not using STACKODS give you what you want directly?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363677#M86163</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T02:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363679#M86164</link>
      <description>Nice, No stackods is better. &lt;BR /&gt;But the name ending with _sum, which is understandable.&lt;BR /&gt;Is there any way to get rid of that _SUM all together? It is not efficient to write 30 rename.&lt;BR /&gt;&lt;BR /&gt;HC&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363679#M86164</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-06-02T02:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363681#M86165</link>
      <description>&lt;P&gt;You don't need that. Your original code was correct, you just needed to not list any variables in the SUM statement, since you'd already done so in the VAR statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=class SUM noprint;
	by sex;
	var weight height age;
	output out=want sum=;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363681#M86165</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T02:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363682#M86166</link>
      <description>&lt;P&gt;What's wrong with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data=PL(keep=TYPE _:) noprint;
  by TYPE;
  output out=SUM sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/363682#M86166</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-02T02:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means for a list of variables start with _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/365142#M86692</link>
      <description>&lt;P&gt;Thanks a lot for your helps.&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 18:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-for-a-list-of-variables-start-with/m-p/365142#M86692</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-06-07T18:51:50Z</dc:date>
    </item>
  </channel>
</rss>

