<?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 Date Format issue in Enterprise Guide in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368408#M87864</link>
    <description>&lt;P&gt;Hello, the date format in the code below create blanks for the columns DAY, MO, YR, and DATE.&lt;/P&gt;&lt;P&gt;The rest of the results are fine&amp;nbsp;except for the new date breakouts.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA SALES (keep= CUSTCODE MO DAY YR DATE HOUR_1-HOUR_24 KWH_TOT);&lt;BR /&gt;SET MONTHLY_SALES ;&lt;BR /&gt;IF OPCOCODE = "DPL";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DAY = DAY(LOAD_DATE) ;&lt;BR /&gt;MO= MONTH(LOAD_DATE);&lt;BR /&gt;YR= YEAR(LOAD_DATE) ;&lt;BR /&gt;DATE = MDY(MO,DAY,YR) ;&lt;/P&gt;&lt;P&gt;FORMAT DATE DATE7.;&lt;/P&gt;&lt;P&gt;KWH_SUB = (SUM(OF HOUR_1-HOUR_24)* 1000);&lt;BR /&gt;KWH_TOT = sum(KWH_SUB,(HOUR_2_*1000));&lt;BR /&gt;IF HOUR_2_&amp;gt;0 THEN HOUR_2 =MEAN(HOUR_2,HOUR_2_);&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 17:46:59 GMT</pubDate>
    <dc:creator>tobyfarms</dc:creator>
    <dc:date>2017-06-19T17:46:59Z</dc:date>
    <item>
      <title>Date Format issue in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368408#M87864</link>
      <description>&lt;P&gt;Hello, the date format in the code below create blanks for the columns DAY, MO, YR, and DATE.&lt;/P&gt;&lt;P&gt;The rest of the results are fine&amp;nbsp;except for the new date breakouts.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA SALES (keep= CUSTCODE MO DAY YR DATE HOUR_1-HOUR_24 KWH_TOT);&lt;BR /&gt;SET MONTHLY_SALES ;&lt;BR /&gt;IF OPCOCODE = "DPL";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DAY = DAY(LOAD_DATE) ;&lt;BR /&gt;MO= MONTH(LOAD_DATE);&lt;BR /&gt;YR= YEAR(LOAD_DATE) ;&lt;BR /&gt;DATE = MDY(MO,DAY,YR) ;&lt;/P&gt;&lt;P&gt;FORMAT DATE DATE7.;&lt;/P&gt;&lt;P&gt;KWH_SUB = (SUM(OF HOUR_1-HOUR_24)* 1000);&lt;BR /&gt;KWH_TOT = sum(KWH_SUB,(HOUR_2_*1000));&lt;BR /&gt;IF HOUR_2_&amp;gt;0 THEN HOUR_2 =MEAN(HOUR_2,HOUR_2_);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368408#M87864</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-06-19T17:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format issue in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368410#M87865</link>
      <description>&lt;P&gt;What does the log say?&lt;/P&gt;
&lt;P&gt;And what's the type/format of the date variable?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368410#M87865</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-19T17:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format issue in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368413#M87866</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Here is a portion of the log pertaining to the date.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: Invalid argument to function DAY(1737763200) at line 29 column 9.&lt;BR /&gt;NOTE: Invalid argument to function MONTH(1737763200) at line 30 column 7.&lt;BR /&gt;NOTE: Invalid argument to function YEAR(1737763200) at line 31 column 7.&lt;BR /&gt;OPCOCODE=DPL LOAD_DATE=25JAN2015:00:00:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The properties indicate being in datetime20. format.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368413#M87866</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-06-19T17:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format issue in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368414#M87867</link>
      <description>&lt;P&gt;Then you have a datetime variable, not a date variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to convert it to a date to use the MONTH/DAY/YEAR functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the DATEPART() function to convert them to dates first.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 18:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368414#M87867</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-19T18:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format issue in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368423#M87872</link>
      <description>&lt;P&gt;That fixed it. &amp;nbsp;Issue resolved!&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 18:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368423#M87872</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-06-19T18:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format issue in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368462#M87881</link>
      <description>&lt;P&gt;And instead of pulling things apart to use this:&lt;/P&gt;
&lt;P&gt;DATE = MDY(MO,DAY,YR) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date = datepart(Load_date);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you have a very specific reason later to have&amp;nbsp; month, day and year variables.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 19:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format-issue-in-Enterprise-Guide/m-p/368462#M87881</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-19T19:23:53Z</dc:date>
    </item>
  </channel>
</rss>

