<?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: Calculation by Dates in SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculation-by-Dates-in-SQL/m-p/314748#M68597</link>
    <description>Noted. I made the changes and it worked . Thanks</description>
    <pubDate>Mon, 28 Nov 2016 06:58:12 GMT</pubDate>
    <dc:creator>afs</dc:creator>
    <dc:date>2016-11-28T06:58:12Z</dc:date>
    <item>
      <title>Calculation by Dates in SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculation-by-Dates-in-SQL/m-p/314725#M68584</link>
      <description>&lt;P&gt;The Sold tables having variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;Alphabetic List of Variables and Attributes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp; Len&amp;nbsp;&amp;nbsp;&amp;nbsp; Format&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp;ShipDay&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8 &amp;nbsp; &amp;nbsp;WeekDAY. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Day of the Week of Shipment&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 &amp;nbsp; &amp;nbsp;dates &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Num &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp;&amp;nbsp;&amp;nbsp; MMDDYY10.&amp;nbsp;&amp;nbsp;&amp;nbsp; Date accessory(s) shipped&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 &amp;nbsp; orders &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Num &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Number of Order&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp;quantity &amp;nbsp; &amp;nbsp; &amp;nbsp;Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Quantity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want to display table containing 3 variables summarizing by year,&amp;nbsp;&amp;nbsp;the total number of accessories sold each month;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select year(datepart(dates)) as A_Year, month(datepart(dates)) as A_Month , sum(quantity) as TTL_Accessories&lt;BR /&gt;from Sold&lt;BR /&gt;group by calculated S_Year,&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am getting log error as&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ERROR: The following columns were not found in the contributing tables: quit.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;97&lt;BR /&gt;98 NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 05:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculation-by-Dates-in-SQL/m-p/314725#M68584</guid>
      <dc:creator>afs</dc:creator>
      <dc:date>2016-11-28T05:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation by Dates in SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculation-by-Dates-in-SQL/m-p/314728#M68586</link>
      <description>&lt;P&gt;&lt;EM&gt;ERROR: The following columns were not found in the contributing tables: quit.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you get such weird error messages then always ask yourself what the heck could trigger SAS to get so confused.&lt;/P&gt;
&lt;P&gt;Very often such errors are the result of a forgotten semicolon - and as you do have a comma instead of a semicolon the SAS compiler believes the "quit" is still part of your group by statement and therefore must be a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW:&lt;/P&gt;
&lt;P&gt;If you also create a Month variable then you'll get 12 rows per year but if you only group by year then all 12 rows in the same year will have the same sum. If you want montly sums then you need to add the month to the group by clause.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 05:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculation-by-Dates-in-SQL/m-p/314728#M68586</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-11-28T05:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation by Dates in SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculation-by-Dates-in-SQL/m-p/314748#M68597</link>
      <description>Noted. I made the changes and it worked . Thanks</description>
      <pubDate>Mon, 28 Nov 2016 06:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculation-by-Dates-in-SQL/m-p/314748#M68597</guid>
      <dc:creator>afs</dc:creator>
      <dc:date>2016-11-28T06:58:12Z</dc:date>
    </item>
  </channel>
</rss>

