<?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: cumulative sum for height in proc sql in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601929#M76415</link>
    <description>&lt;P&gt;Dead simple:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;create table&lt;/LI&gt;
&lt;LI&gt;select age&lt;/LI&gt;
&lt;LI&gt;also select sum(height) as cumulative&lt;/LI&gt;
&lt;LI&gt;from sashelp.class&lt;/LI&gt;
&lt;LI&gt;group by age&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Build the SQL code by following the hints, and let us see what you come up with.&lt;/P&gt;
&lt;P&gt;As already stated in another thread, I will not insult your intelligence by spoon-feeding you this very simple exercise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS a home exercise is for you to solve. If you can't, there's three possibilities:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;you don't have what it takes for the course; drop out of the course and do something you're equipped for&lt;/LI&gt;
&lt;LI&gt;you did not follow your teacher properly; be more attentive in the future&lt;/LI&gt;
&lt;LI&gt;your teacher is not capable; take the course from someone else&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 06 Nov 2019 10:27:26 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-11-06T10:27:26Z</dc:date>
    <item>
      <title>cumulative sum for height in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601921#M76410</link>
      <description>&lt;P&gt;Hi Good Eveyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to find cumulative sum for height in class library&amp;nbsp;&lt;/P&gt;&lt;P&gt;using proc sql&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn;
set sashelp.class;
run;

proc sort data=dsn;
by age;
run;

data dsn1;
set dsn;
by age;
retain cumulative 0.;
if first.height then height+cumulative;
else  cumulative+height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601921#M76410</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-11-06T10:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum for height in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601922#M76411</link>
      <description>&lt;P&gt;If you simply want a cumulative sum of heights and do not want to consider by-groups, then no by-statement is needed in the data step. Simply do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=dsn;
    by age;
run;

data want;
    set dsn;
    cumulative+height;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601922#M76411</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-06T10:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum for height in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601925#M76412</link>
      <description>&lt;P&gt;i want using proc sql sort by age variable&amp;nbsp; and output cumulative sum of height&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601925#M76412</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-11-06T10:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum for height in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601927#M76413</link>
      <description>&lt;P&gt;Why? So much easier with the data step&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601927#M76413</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-06T10:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum for height in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601928#M76414</link>
      <description>&lt;P&gt;Hi draycut&amp;nbsp;&lt;/P&gt;&lt;P&gt;its just do for homework&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601928#M76414</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-11-06T10:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum for height in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601929#M76415</link>
      <description>&lt;P&gt;Dead simple:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;create table&lt;/LI&gt;
&lt;LI&gt;select age&lt;/LI&gt;
&lt;LI&gt;also select sum(height) as cumulative&lt;/LI&gt;
&lt;LI&gt;from sashelp.class&lt;/LI&gt;
&lt;LI&gt;group by age&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Build the SQL code by following the hints, and let us see what you come up with.&lt;/P&gt;
&lt;P&gt;As already stated in another thread, I will not insult your intelligence by spoon-feeding you this very simple exercise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS a home exercise is for you to solve. If you can't, there's three possibilities:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;you don't have what it takes for the course; drop out of the course and do something you're equipped for&lt;/LI&gt;
&lt;LI&gt;you did not follow your teacher properly; be more attentive in the future&lt;/LI&gt;
&lt;LI&gt;your teacher is not capable; take the course from someone else&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-sum-for-height-in-proc-sql/m-p/601929#M76415</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T10:27:26Z</dc:date>
    </item>
  </channel>
</rss>

