<?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 cumulative sales for two months in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/cumulative-sales-for-two-months/m-p/897663#M354753</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Prdsales;
input prdcode $ Jan_sale Feb_sale;
cards;
P101 230 450
P102 340 320
P103 210 250
;
run;

proc sort data=prdsales ;
by prdcode;
run;

data sales_cum;
set prdsales;
by prdcode;
if first.prdcode=1 then cumsale=0;
cumsale+jan_sale;
run;&lt;BR /&gt;&lt;BR /&gt;/*QUESTION1:-How to calculate cumulative sales for each month in the above code&lt;BR /&gt;i            i want to caluculate jan_sale and f_sale for each month cumulative sales?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 07 Oct 2023 06:24:29 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2023-10-07T06:24:29Z</dc:date>
    <item>
      <title>cumulative sales for two months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cumulative-sales-for-two-months/m-p/897663#M354753</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Prdsales;
input prdcode $ Jan_sale Feb_sale;
cards;
P101 230 450
P102 340 320
P103 210 250
;
run;

proc sort data=prdsales ;
by prdcode;
run;

data sales_cum;
set prdsales;
by prdcode;
if first.prdcode=1 then cumsale=0;
cumsale+jan_sale;
run;&lt;BR /&gt;&lt;BR /&gt;/*QUESTION1:-How to calculate cumulative sales for each month in the above code&lt;BR /&gt;i            i want to caluculate jan_sale and f_sale for each month cumulative sales?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Oct 2023 06:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cumulative-sales-for-two-months/m-p/897663#M354753</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-10-07T06:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sales for two months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cumulative-sales-for-two-months/m-p/897664#M354754</link>
      <description>&lt;P&gt;Use PROC MEANS/SUMMARY:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=prdsales nway;
class prdcode;
var jan_sale feb_sale;
output out=want (drop=_type_ _freq_) sum()=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Oct 2023 07:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cumulative-sales-for-two-months/m-p/897664#M354754</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-07T07:15:15Z</dc:date>
    </item>
  </channel>
</rss>

