<?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/437756#M109068</link>
    <description>&lt;P&gt;PROC MEANS does not compute statistics for character variables.&amp;nbsp; You need to create a new variable, make it numeric, and have it contain the numeric piece of SITE_NUMBER.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;newvar = input( compress(site_number, , 'kd' ), 5.);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can process the new variable with PROC MEANS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the numeric portion is always the first four or five characters of SITE_NUMBER, the formula can be simplified:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = input(site_number, 5.);&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2018 20:19:05 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-02-15T20:19:05Z</dc:date>
    <item>
      <title>proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437745#M109062</link>
      <description>&lt;P&gt;I have a numeric variable which includes some written characteristics parts like the following&lt;/P&gt;&lt;P&gt;the problem is I need to&amp;nbsp;calculate&amp;nbsp;some statistics for the variable by proc mean and it doesn't let me bc of the written characteristic &amp;nbsp;part. this is the error that I got&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Variable site_number in list does not match type prescribed for this list&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I need a way to ask sas to ignore the written part and just calculate the numeric&lt;/P&gt;&lt;P&gt;or substr the numeric part&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1453&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1601&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1602&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1700&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1750&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5002&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5003&lt;BR /&gt;Main Campus&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5003&lt;BR /&gt;Burbank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437745#M109062</guid>
      <dc:creator>mona4u</dc:creator>
      <dc:date>2018-02-15T19:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437746#M109063</link>
      <description>&lt;P&gt;filter using&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where anyalpha(var)=0;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437746#M109063</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-15T19:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437749#M109064</link>
      <description>&lt;P&gt;this code isn't working&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 20:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437749#M109064</guid>
      <dc:creator>mona4u</dc:creator>
      <dc:date>2018-02-15T20:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437751#M109065</link>
      <description>&lt;P&gt;post your code and log please&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 20:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437751#M109065</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-15T20:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437756#M109068</link>
      <description>&lt;P&gt;PROC MEANS does not compute statistics for character variables.&amp;nbsp; You need to create a new variable, make it numeric, and have it contain the numeric piece of SITE_NUMBER.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;newvar = input( compress(site_number, , 'kd' ), 5.);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can process the new variable with PROC MEANS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the numeric portion is always the first four or five characters of SITE_NUMBER, the formula can be simplified:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = input(site_number, 5.);&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 20:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437756#M109068</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-15T20:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437773#M109080</link>
      <description>&lt;P&gt;You need to clean your data before you analyze it. With the data in the form shown, I suspect it was not read in correctly to start.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 20:49:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437773#M109080</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-15T20:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437820#M109099</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134228"&gt;@mona4u&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;this code isn't working&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 23:23:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-means/m-p/437820#M109099</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-15T23:23:40Z</dc:date>
    </item>
  </channel>
</rss>

