<?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 Proc Means in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means/m-p/563377#M157933</link>
    <description>&lt;P&gt;I initially ran a data set which looks like this which had 34 columns and each column had 18 obs.:&lt;/P&gt;&lt;P&gt;OBS &amp;nbsp; &amp;nbsp;&amp;nbsp; KL1&amp;nbsp; KL2..KL3 KL4....KL34&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&amp;nbsp;18&lt;/P&gt;&lt;P&gt;This data set ran okay with proc means giving me the sum of KL1&amp;nbsp; KL2 etc. each in a row resulting in the data set all below.&lt;/P&gt;&lt;P&gt;I would like to obtain the sum of KL1-KL3 for the data set all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable &amp;nbsp;&amp;nbsp; Sum&lt;/P&gt;&lt;P&gt;KL1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 0.014&lt;/P&gt;&lt;P&gt;KL2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.009&lt;/P&gt;&lt;P&gt;KL3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.034&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data =all sum;
var KL1-Kl3;
output out=klall  sum=/autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I run the above code I get an error that KL1 not found.&amp;nbsp; Can some on tell me why it is not reading the variables?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2019 19:52:27 GMT</pubDate>
    <dc:creator>jacksonan123</dc:creator>
    <dc:date>2019-06-03T19:52:27Z</dc:date>
    <item>
      <title>Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means/m-p/563377#M157933</link>
      <description>&lt;P&gt;I initially ran a data set which looks like this which had 34 columns and each column had 18 obs.:&lt;/P&gt;&lt;P&gt;OBS &amp;nbsp; &amp;nbsp;&amp;nbsp; KL1&amp;nbsp; KL2..KL3 KL4....KL34&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&amp;nbsp;18&lt;/P&gt;&lt;P&gt;This data set ran okay with proc means giving me the sum of KL1&amp;nbsp; KL2 etc. each in a row resulting in the data set all below.&lt;/P&gt;&lt;P&gt;I would like to obtain the sum of KL1-KL3 for the data set all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable &amp;nbsp;&amp;nbsp; Sum&lt;/P&gt;&lt;P&gt;KL1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 0.014&lt;/P&gt;&lt;P&gt;KL2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.009&lt;/P&gt;&lt;P&gt;KL3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.034&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data =all sum;
var KL1-Kl3;
output out=klall  sum=/autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I run the above code I get an error that KL1 not found.&amp;nbsp; Can some on tell me why it is not reading the variables?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means/m-p/563377#M157933</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-06-03T19:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means/m-p/563380#M157935</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I initially ran a data set which looks like this which had 34 columns and each column had 18 obs.:&lt;/P&gt;
&lt;P&gt;OBS &amp;nbsp; &amp;nbsp;&amp;nbsp; KL1&amp;nbsp; KL2..KL3 KL4....KL34&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;18&lt;/P&gt;
&lt;P&gt;This data set ran okay with proc means giving me the sum of KL1&amp;nbsp; KL2 etc. each in a row resulting in the data set all below.&lt;/P&gt;
&lt;P&gt;I would like to obtain the sum of KL1-KL3 for the data set all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable &amp;nbsp;&amp;nbsp; Sum&lt;/P&gt;
&lt;P&gt;KL1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 0.014&lt;/P&gt;
&lt;P&gt;KL2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.009&lt;/P&gt;
&lt;P&gt;KL3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.034&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data =all sum;
var KL1-Kl3;
output out=klall  sum=/autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I run the above code I get an error that KL1 not found.&amp;nbsp; Can some on tell me why it is not reading the variables?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use the output data set Klall as input to a data step and do the addition there:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set klall;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; kl1_kl3_sum = sum(kl1_sum, kl2_sum,kl3_sum);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or optionally sum each record prior to proc means add that variable to the VAR statement: sums of sums don't matter on the order.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 20:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means/m-p/563380#M157935</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-03T20:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Means/m-p/563410#M157945</link>
      <description>The final code based upon your suggestion that worked was:&lt;BR /&gt;&lt;BR /&gt;Proc means data =kl sum;&lt;BR /&gt;&lt;BR /&gt;Var skl1-skl3;&lt;BR /&gt;&lt;BR /&gt;Output out =klall sum=autolabel; run;&lt;BR /&gt;&lt;BR /&gt;Data want;&lt;BR /&gt;&lt;BR /&gt;Set klall;&lt;BR /&gt;&lt;BR /&gt;asum=sum(skl1,skl2,skl3);&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jun 2019 23:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Means/m-p/563410#M157945</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-06-03T23:14:58Z</dc:date>
    </item>
  </channel>
</rss>

