<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616749#M180614</link>
    <description>What are you trying to do here? Get through a course or learn SAS. If it's the first, please continue as is. If you're actually trying to learn SAS, these questions are good but they will not teach you to be an effective SAS programmer at all.</description>
    <pubDate>Sun, 12 Jan 2020 01:21:30 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-01-12T01:21:30Z</dc:date>
    <item>
      <title>Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616717#M180589</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please correct me if I wrong coded in the below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*Scenario:&lt;/P&gt;
&lt;P&gt;1. Subset the data into two data sets, work.young and work.mid based on Age variable.&lt;/P&gt;
&lt;P&gt;2. work.young should contain observations with Age less than 40 years old.&lt;/P&gt;
&lt;P&gt;3. work.mid should contain observations with Age between 40 and 65 years old, inclusively.&lt;/P&gt;
&lt;P&gt;4. How many observations are in the mid data set?&lt;/P&gt;
&lt;P&gt;5. What is the CustomerId for observation 14 in the young data set?&lt;/P&gt;
&lt;P&gt;6. What is the average Age of the customer in the young data set? */&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.young work.mid;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Souj.Input41;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Age&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;40&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.young;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;40&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;lt;= Age &amp;lt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;65&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.mid;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=work.young;&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/*I think,#6*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Age;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2020 19:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616717#M180589</guid>
      <dc:creator>souji</dc:creator>
      <dc:date>2020-01-11T19:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616719#M180591</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301371"&gt;@souji&lt;/a&gt;&lt;BR /&gt;It seems to be fine &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;</description>
      <pubDate>Sat, 11 Jan 2020 19:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616719#M180591</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-11T19:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616722#M180593</link>
      <description>&lt;P&gt;Thank You to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2020 20:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616722#M180593</guid>
      <dc:creator>souji</dc:creator>
      <dc:date>2020-01-11T20:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616729#M180599</link>
      <description>&lt;P&gt;As I discussed earlier, there is no need to split the data into two data sets to do these analyses. If some instructor is requesting that you do this, they are teaching you a rather weak and ineffective technique in SAS. This can all be done without creating one or two new datasets using PROC MEANS. While this may not make the slightest difference in a small problem, it could make a difference using huge real world data sets, and splitting data sets up like this is also not a good way to program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value agef. low-&amp;lt;40='0-40' 40-65='40-65';
run;

proc means data=souj.input41;
var age;
format age agef.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or #6 can be programmed like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=souj.input41(where=(40&amp;lt;=age&amp;lt;=65));
var Age;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2020 23:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616729#M180599</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-11T23:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616749#M180614</link>
      <description>What are you trying to do here? Get through a course or learn SAS. If it's the first, please continue as is. If you're actually trying to learn SAS, these questions are good but they will not teach you to be an effective SAS programmer at all.</description>
      <pubDate>Sun, 12 Jan 2020 01:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/616749#M180614</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-12T01:21:30Z</dc:date>
    </item>
  </channel>
</rss>

