<?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 sum vertically in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318842#M69910</link>
    <description>&lt;P&gt;Hii ,I have a data set shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sex &amp;nbsp; &amp;nbsp;count&lt;/P&gt;&lt;P&gt;f &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;122&lt;/P&gt;&lt;P&gt;m &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the following output&lt;/P&gt;&lt;P&gt;sex &amp;nbsp; &amp;nbsp;count&lt;/P&gt;&lt;P&gt;f &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 122&lt;/P&gt;&lt;P&gt;m &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100 &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;t &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 222&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this has to be done in data step only ,don't use procedures&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2016 11:34:25 GMT</pubDate>
    <dc:creator>molla</dc:creator>
    <dc:date>2016-12-14T11:34:25Z</dc:date>
    <item>
      <title>sum vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318842#M69910</link>
      <description>&lt;P&gt;Hii ,I have a data set shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sex &amp;nbsp; &amp;nbsp;count&lt;/P&gt;&lt;P&gt;f &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;122&lt;/P&gt;&lt;P&gt;m &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the following output&lt;/P&gt;&lt;P&gt;sex &amp;nbsp; &amp;nbsp;count&lt;/P&gt;&lt;P&gt;f &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 122&lt;/P&gt;&lt;P&gt;m &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100 &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;t &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 222&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this has to be done in data step only ,don't use procedures&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 11:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318842#M69910</guid>
      <dc:creator>molla</dc:creator>
      <dc:date>2016-12-14T11:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: sum vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318850#M69912</link>
      <description>&lt;P&gt;Look up the RETAIN statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 11:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318850#M69912</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-14T11:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: sum vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318857#M69914</link>
      <description>&lt;P&gt;Use &lt;STRONG&gt;RETAIN&lt;/STRONG&gt; total and add the &lt;STRONG&gt;count&lt;/STRONG&gt; to it at every observation.&lt;/P&gt;
&lt;P&gt;Assign a variable to&amp;nbsp;&lt;STRONG&gt;set&lt;/STRONG&gt; input with &lt;STRONG&gt;end= &amp;nbsp; &amp;nbsp; (&lt;/STRONG&gt;like end=&lt;STRONG&gt;eof)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;and next lines to your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IF eof then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sex = 'TOTAL';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;count = total;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; end;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 11:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318857#M69914</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-14T11:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: sum vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318905#M69930</link>
      <description>&lt;P&gt;Just looking at the elephant from a slightly different viewpoint:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want (drop=totcount);&lt;/P&gt;
&lt;P&gt;do until (done);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;set have end=done;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;totcount + count;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;sex='t';&lt;/P&gt;
&lt;P&gt;count = totcount;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 12:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318905#M69930</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-12-14T12:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: sum vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318965#M69949</link>
      <description>&lt;P&gt;Please be aware that the habit of putting a summary value into a data set unless strictly for the purpose of display (in which case a report procedure&amp;nbsp;may be more appropriate for many other reasons)&amp;nbsp;is likely to cause problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For instance if you were to take your resulting data set into a regression type analysis you now have 3 levels of "sex" and one of them has way larger values than the other. Results could be quite entertaining... Worse would be an analysis that does not consider Sex but just uses the count.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 15:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-vertically/m-p/318965#M69949</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-14T15:38:23Z</dc:date>
    </item>
  </channel>
</rss>

