<?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 Summing variables in a dataset by date in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32261#M7738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="timesnewroman"&gt;&lt;SPAN style="font-family: Cambria;"&gt; Tried the code above with slight changes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; background-color: white; font-family: Courier New;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; test;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;set&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; totalokkkk;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; test (keep=date value);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;format&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; date &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;date6.&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;&amp;nbsp;&amp;nbsp; Date=&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'yymm6'd&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;do&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;while&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; (Date&amp;lt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'2011-01'd&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;do&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; country=&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;to1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=ceil(ranuni(&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;)*&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;10&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;output&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;end&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date=intnx(&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;&lt;STRONG style="color: purple; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'month'&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;, Date, &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;,&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;&lt;STRONG style="color: purple; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'b'&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;end&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;proc&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=test &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;noprint&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Cambria; color: navy; font-size: 10pt;"&gt; &lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;means&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;class&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt; Date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;var&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt; SMB_Dom;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;types&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; Date;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;output&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;out&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=SumPerMonth(drop=_:) &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;sum&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=SumPerMonth &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; ;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;title&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;&lt;STRONG style="color: purple; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'Sum per Month'&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;proc&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=SumPerMonth &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;noobs&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Cambria; color: navy; font-size: 10pt;"&gt; &lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="timesnewroman"&gt;&lt;SPAN style="font-family: Cambria;"&gt;&lt;STRONG&gt;The error code received was related to the date part:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Cambria; color: navy; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 8pt; font-family: Cambria;"&gt;ERROR: Invalid date/time/datetime constant 'yymm6'd.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; font-family: Cambria;"&gt;ERROR: Invalid date/time/datetime constant '2011-01'd.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; font-family: Cambria;"&gt;ERROR 77-185: Invalid number conversion on '2011-01'd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 8pt; font-family: Courier New;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jan 2012 13:14:37 GMT</pubDate>
    <dc:creator>carbs</dc:creator>
    <dc:date>2012-01-18T13:14:37Z</dc:date>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32259#M7736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset with monthly observations of variable x for 10 countries between 2000-2010. How could I sum the monthly observations of countries together, so that the final dataset would contain only one variable (all countries' x values summed) between 2000-2010? I tried proc means sum, but couldn't manage to sum by date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 09:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32259#M7736</guid>
      <dc:creator>carbs</dc:creator>
      <dc:date>2012-01-18T09:50:33Z</dc:date>
    </item>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32260#M7737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have (keep=Date value);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; format date date9.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Date='01jan2005'd;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do while (Date&amp;lt;'01dec2011'd);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do country=1 to 10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=ceil(ranuni(1)*10);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date=intnx('month', Date, 1,'b');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=have noprint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; class Date;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var Value;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; types Date;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; output out=SumPerMonth(drop=_:) sum=SumPerMonth &lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title 'Sum per Month';&lt;BR /&gt;proc print data=SumPerMonth noobs;&lt;BR /&gt;run;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 11:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32260#M7737</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-01-18T11:46:26Z</dc:date>
    </item>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32261#M7738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="timesnewroman"&gt;&lt;SPAN style="font-family: Cambria;"&gt; Tried the code above with slight changes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; background-color: white; font-family: Courier New;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; test;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;set&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; totalokkkk;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; test (keep=date value);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;format&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; date &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;date6.&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;&amp;nbsp;&amp;nbsp; Date=&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'yymm6'd&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;do&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;while&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; (Date&amp;lt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'2011-01'd&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;do&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; country=&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;to1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=ceil(ranuni(&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;)*&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;10&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;output&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;end&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date=intnx(&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;&lt;STRONG style="color: purple; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'month'&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;, Date, &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;,&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;&lt;STRONG style="color: purple; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'b'&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;end&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;proc&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=test &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;noprint&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Cambria; color: navy; font-size: 10pt;"&gt; &lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;means&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;class&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt; Date;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;var&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="SV" style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt; SMB_Dom;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;types&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt; Date;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;output&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;out&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=SumPerMonth(drop=_:) &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;sum&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=SumPerMonth &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; ;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;title&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;&lt;STRONG style="color: purple; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;'Sum per Month'&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;proc&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="color: black; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;=SumPerMonth &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="color: blue; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;noobs&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Cambria; color: navy; font-size: 10pt;"&gt; &lt;SPAN style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: Cambria;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="timesnewroman"&gt;&lt;SPAN style="font-family: Cambria;"&gt;&lt;STRONG&gt;The error code received was related to the date part:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Cambria; color: navy; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 8pt; font-family: Cambria;"&gt;ERROR: Invalid date/time/datetime constant 'yymm6'd.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; font-family: Cambria;"&gt;ERROR: Invalid date/time/datetime constant '2011-01'd.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; font-family: Cambria;"&gt;ERROR 77-185: Invalid number conversion on '2011-01'd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 8pt; font-family: Courier New;"&gt;﻿&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 13:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32261#M7738</guid>
      <dc:creator>carbs</dc:creator>
      <dc:date>2012-01-18T13:14:37Z</dc:date>
    </item>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32262#M7739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why did you change the form of the date constant?&amp;nbsp; I'm not sure if the form you used is valid.&amp;nbsp; It isn't one of the forms listed in the documentation: &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780334.htm"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780334.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and, besides, the statment: &lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: white; font-size: 10pt; color: black; font-family: Cambria;"&gt;&amp;nbsp; Date=&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: teal;"&gt;&lt;STRONG style="background-color: white; font-size: 10pt; font-family: Cambria;"&gt;'yymm6'd&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-size: 10pt; color: black;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is definitely incorrect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 13:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32262#M7739</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-18T13:23:13Z</dc:date>
    </item>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32263#M7740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; change "&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;do &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;while&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt; (Date&amp;lt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: teal; font-size: 10pt;"&gt;'2011-01'd&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt;)" to "&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;do &lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: blue; font-size: 10pt;"&gt;while&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt; (Date&amp;lt;&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: teal; font-size: 10pt;"&gt;mdy(1,1,2011)&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&lt;STRONG style="background-color: white; font-family: Cambria; color: black; font-size: 10pt;"&gt;);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 13:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32263#M7740</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-18T13:25:43Z</dc:date>
    </item>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32264#M7741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the dates in my data in the following form: 2000-01, 2000-02 etc.. That's why I thought I could change the date form. I uploaded to the first post a sample of the data I have, so it includes much more stuff than mentioned also. I get SAS to sum some values with the code by Patrick, but I guess it sums all variables together, even though I just want the SMB_Dom to be summed....Thanks for the answers already, and patience &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 14:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32264#M7741</guid>
      <dc:creator>carbs</dc:creator>
      <dc:date>2012-01-18T14:51:33Z</dc:date>
    </item>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32265#M7742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you look at the actual values that are assigned to your dates, as long as they are SAS dates and only formatted to appear as year and month, you will see that they actually reflect the first of each month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, your approach is correct regarding the sum.&amp;nbsp; I didn't catch it initially, but you are summing a variable that you don't create in your example data.&amp;nbsp; You only create a variable called "value", but then try to sum a variable called "SMB_Dom".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 14:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32265#M7742</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-18T14:59:09Z</dc:date>
    </item>
    <item>
      <title>Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32266#M7743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Good clarification relating to the dates, thanks art297! Somehow the whole approach of Patrick's code is a bit unclear for me, why it has to be done in such a complicated way..Since I already have the SMB_Dom variable according to dates, and would need to sum up countries' SMB_Dom values each month.. How should I change the code to be able to sum the variable SMB_Dom then? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 19:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32266#M7743</guid>
      <dc:creator>carbs</dc:creator>
      <dc:date>2012-01-18T19:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32267#M7744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking for something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; sum_dom date $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.05645&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.07511&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.08539&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.06388&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.06893&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.14131&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.08486&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.2402&amp;nbsp;&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.04822&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.05328&amp;nbsp; 2000-01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.05645&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.07511&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.08539&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.06388&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.06893&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.14131&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.08486&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.2402&amp;nbsp;&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.04822&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;0.05328&amp;nbsp; 2000-02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; first.date &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; total=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; total+sum_dom;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; last.date &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 19:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32267#M7744</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-18T19:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Summing variables in a dataset by date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32268#M7745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Linlin! Your code did the job. Perhaps my question wasn't that easy to understand at the beginning but I'm glad you had the time to help &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 21:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Summing-variables-in-a-dataset-by-date/m-p/32268#M7745</guid>
      <dc:creator>carbs</dc:creator>
      <dc:date>2012-01-18T21:08:29Z</dc:date>
    </item>
  </channel>
</rss>

