<?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 by based on Dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/sum-by-based-on-Dates/m-p/18038#M3494</link>
    <description>i have &lt;BR /&gt;
&lt;BR /&gt;
data report;&lt;BR /&gt;
input dat tran;&lt;BR /&gt;
format dat mmddyy8.;&lt;BR /&gt;
cards;&lt;BR /&gt;
10/12/98 45&lt;BR /&gt;
10/16/98 66&lt;BR /&gt;
10/26/98 23&lt;BR /&gt;
11/06/00 89&lt;BR /&gt;
11/20/00 75&lt;BR /&gt;
11/23/00 45&lt;BR /&gt;
11/29/00 63&lt;BR /&gt;
&lt;BR /&gt;
Now i want the sum of tran between 10/12/98 to 10/16/98, and i want the sum of tran from 11/06/00 to 11/23/00 in to a new variable Total .if the trans is not between the mentioned dates it should remain  same .

Message was edited by: Main</description>
    <pubDate>Tue, 14 Apr 2009 05:58:19 GMT</pubDate>
    <dc:creator>R_Win</dc:creator>
    <dc:date>2009-04-14T05:58:19Z</dc:date>
    <item>
      <title>sum by based on Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sum-by-based-on-Dates/m-p/18038#M3494</link>
      <description>i have &lt;BR /&gt;
&lt;BR /&gt;
data report;&lt;BR /&gt;
input dat tran;&lt;BR /&gt;
format dat mmddyy8.;&lt;BR /&gt;
cards;&lt;BR /&gt;
10/12/98 45&lt;BR /&gt;
10/16/98 66&lt;BR /&gt;
10/26/98 23&lt;BR /&gt;
11/06/00 89&lt;BR /&gt;
11/20/00 75&lt;BR /&gt;
11/23/00 45&lt;BR /&gt;
11/29/00 63&lt;BR /&gt;
&lt;BR /&gt;
Now i want the sum of tran between 10/12/98 to 10/16/98, and i want the sum of tran from 11/06/00 to 11/23/00 in to a new variable Total .if the trans is not between the mentioned dates it should remain  same .

Message was edited by: Main</description>
      <pubDate>Tue, 14 Apr 2009 05:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sum-by-based-on-Dates/m-p/18038#M3494</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-04-14T05:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: sum by based on Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sum-by-based-on-Dates/m-p/18039#M3495</link>
      <description>A set of SAS assignment statements as illustrated below will work:&lt;BR /&gt;
&lt;BR /&gt;
IF &lt;CONDITION&gt; THEN &lt;ASSIGNMENT&gt;;&lt;BR /&gt;
ELSE IF &lt;CONDITION&gt; THEN &lt;ASSIGNMENT&gt;;&lt;BR /&gt;
ELSE &lt;ASSIGNMENT&gt;;&lt;BR /&gt;
&lt;BR /&gt;
Explore using SAS literal strings expressed as DATE values for your defined &lt;CONDITION&gt; as explained in your post.  The literal must be surrounded in either single- or double-quotes suffixed with a "D" character.&lt;BR /&gt;
&lt;BR /&gt;
You have a wealth of SAS documentation and supplemental technical / conference papers available at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;   website using its SEARCH facility or with a GOOGLE search.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Using SAS® Dates and Times – A Tutorial&lt;BR /&gt;
Jonas V. Bilenas, JP Morgan Chase, Wilmington, DE&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2007/226-2007.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2007/226-2007.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Entering Dates&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001397901.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001397901.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Working with Dates in the SAS System&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm&lt;/A&gt;&lt;/CONDITION&gt;&lt;/ASSIGNMENT&gt;&lt;/ASSIGNMENT&gt;&lt;/CONDITION&gt;&lt;/ASSIGNMENT&gt;&lt;/CONDITION&gt;</description>
      <pubDate>Tue, 14 Apr 2009 13:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sum-by-based-on-Dates/m-p/18039#M3495</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-04-14T13:10:13Z</dc:date>
    </item>
  </channel>
</rss>

