<?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 summary/means combine class/by variables unexpectedly in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343740#M63425</link>
    <description>&lt;P&gt;Note that ability to assign variables to groups by use of a format is a very powerful tool in SAS. For example if you have SAS date values you can get summaries by Year, Year and Month, Month, Day of month, Day of year (1-365), Calendar quarter, Year and calendar quarter, day of the week, and week of the year by using a different format for the same variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And most of the analysis procedures will group values accordingly.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2017 14:59:07 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-03-23T14:59:07Z</dc:date>
    <item>
      <title>proc summary/means combine class/by variables unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343495#M63392</link>
      <description>&lt;P&gt;/* When I run the following PC SAS program, all the id’s are summarized into the first id, which is wrong. */&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; @ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; id &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;15.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;17&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; amt &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;098022134104033 1&lt;/P&gt;
&lt;P&gt;098022134104033 2&lt;/P&gt;
&lt;P&gt;098022134433892 3&lt;/P&gt;
&lt;P&gt;098022134433892 4&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;summary&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nway&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; amt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=test1(drop=_type_ _freq_) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;sum&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=test1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;z15.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 20:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343495#M63392</guid>
      <dc:creator>Warren</dc:creator>
      <dc:date>2017-03-22T20:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc summary/means combine class/by variables unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343497#M63393</link>
      <description>&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Microsoft Sans Serif" size="3"&gt;I got the following answer from SAS Technical Support:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Microsoft Sans Serif" size="3"&gt;You need to apply a format in advance to the ID variable as PROC SUMMARY is using BEST12. behind the scenes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Microsoft Sans Serif" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Microsoft Sans Serif" size="3"&gt;Example:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Microsoft Sans Serif" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;&lt;FONT color="#000080"&gt;data&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt; test; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;input&lt;/FONT&gt;&lt;FONT color="#000000"&gt; @ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt; id &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;15.&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;17&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt; amt &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;1.&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000" face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT color="#000000"&gt; id &lt;/FONT&gt;&lt;FONT color="#008080"&gt;z15.&lt;/FONT&gt;&lt;FONT color="#000000"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#0000ff"&gt;cards&lt;/FONT&gt;&lt;FONT color="#000000"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#000000"&gt;...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 20:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343497#M63393</guid>
      <dc:creator>Warren</dc:creator>
      <dc:date>2017-03-22T20:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc summary/means combine class/by variables unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343511#M63395</link>
      <description>&lt;P&gt;It's a good idea to keep ID fields as character fields for this reason.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 21:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343511#M63395</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-22T21:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc summary/means combine class/by variables unexpectedly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343740#M63425</link>
      <description>&lt;P&gt;Note that ability to assign variables to groups by use of a format is a very powerful tool in SAS. For example if you have SAS date values you can get summaries by Year, Year and Month, Month, Day of month, Day of year (1-365), Calendar quarter, Year and calendar quarter, day of the week, and week of the year by using a different format for the same variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And most of the analysis procedures will group values accordingly.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:59:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-summary-means-combine-class-by-variables-unexpectedly/m-p/343740#M63425</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-23T14:59:07Z</dc:date>
    </item>
  </channel>
</rss>

