<?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: YTD Calculation in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60230#M17064</link>
    <description>What you have suggested sounds reasonable.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 04 Aug 2010 17:34:43 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-08-04T17:34:43Z</dc:date>
    <item>
      <title>YTD Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60227#M17061</link>
      <description>I am looking for the YTD calculation and for a particular id, if there is no quantity in that month but there are quantities in previous months, it need to be '0' for that month and Year to date (sum) for that month. Thanks in advance for your suggestions&lt;BR /&gt;
&lt;BR /&gt;
Input file:&lt;BR /&gt;
data test;&lt;BR /&gt;
input id $ date monyy7. quantity;&lt;BR /&gt;
infile cards;&lt;BR /&gt;
A Jan2010 12&lt;BR /&gt;
A Feb2010 13&lt;BR /&gt;
B Feb2010 15&lt;BR /&gt;
C Jan2010 10&lt;BR /&gt;
&lt;BR /&gt;
Output required is:&lt;BR /&gt;
&lt;BR /&gt;
Date Id Quantity YTD_Quantity&lt;BR /&gt;
Jan2010 A 12 12&lt;BR /&gt;
Jan2010 C 10 10&lt;BR /&gt;
Feb2010 A 13 25&lt;BR /&gt;
Feb2010 B 15 15&lt;BR /&gt;
Feb2010 C 0 10&lt;BR /&gt;
;&lt;BR /&gt;
Thanks

Message was edited by: nash</description>
      <pubDate>Wed, 04 Aug 2010 14:39:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60227#M17061</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-08-04T14:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60228#M17062</link>
      <description>Create a SAS file containing only unique DATE variable values (PROC SORT NODUPKEY), then MERGE (with BY DATE) the new file back onto your WORK.TEST file, giving you one observation for each ID/DATE combination, some obs having a "SAS missing" value for QUANTITY.&lt;BR /&gt;
&lt;BR /&gt;
Then look at using PROC SUMMARY to generate your cumulative SUM metric.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 04 Aug 2010 16:18:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60228#M17062</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-04T16:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60229#M17063</link>
      <description>Scott,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your suggestion. In the example, I mentioned only two months but real data has 12 months and it will be 12 small datasets and merging will be with those 12 files. Is there a better way to this ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 04 Aug 2010 16:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60229#M17063</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-08-04T16:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60230#M17064</link>
      <description>What you have suggested sounds reasonable.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 04 Aug 2010 17:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/YTD-Calculation/m-p/60230#M17064</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-04T17:34:43Z</dc:date>
    </item>
  </channel>
</rss>

