<?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: How do I change SAS Datetime value to Month-Year value? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257297#M18027</link>
    <description>&lt;P&gt;What do you mean it considers the actual date?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc SQL doesn't recognize formats when using Group By, but proc means and proc freq will.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2016 13:57:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-03-17T13:57:22Z</dc:date>
    <item>
      <title>How do I change SAS Datetime value to Month-Year value?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257257#M18020</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to convert datetime formats into month-year format in SAS and use them to sum&amp;nbsp;a column by month and year. I have tried using 100*YEAR(DATEPART(DATE_VALUE))+MONTH(DATEPART(DATE_VALUE)) and it does work. But when I try to plot them on a graph, the dates are considered as numerical values which results in some random numbers on the horizontal axis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the MMMYY formats, but those only format the dates into MONTH-YEAR format, they dont actually change the values of the date, and it wont let me group the columns by month and year, since their actual values are still unique.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 11:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257257#M18020</guid>
      <dc:creator>aj211191</dc:creator>
      <dc:date>2016-03-17T11:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change SAS Datetime value to Month-Year value?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257263#M18021</link>
      <description>&lt;P&gt;Then use the format in a put() function, the result is stored as a char: WYSIWYG.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 12:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257263#M18021</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-17T12:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change SAS Datetime value to Month-Year value?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257265#M18022</link>
      <description>&lt;P&gt;It is always a good idea to post test data (in a datastep) of what you have, and what you want the output to look like. &amp;nbsp;I have taken a guess at the below:&lt;/P&gt;
&lt;PRE&gt;data have;
  thedt="01JAN2014:01:00:00"dt; val=6; output;
  thedt="01JAN2014:06:10:00"dt; val=18; output;
  thedt="04MAR2014:03:00:00"dt; val=6; output;
  thedt="15MAR2014:04:00:00"dt; val=7; output;
  thedt="12JAN2015:01:00:00"dt; val=5; output;
  thedt="14JAN2014:01:00:00"dt; val=10; output;
run;

proc sql;
  create table WANT as
  select  YEAR,
          MONTH,          
          sum(VAL) as RESULT
  from    (select year(datepart(THEDT)) as YEAR,month(datepart(THEDT)) as MONTH,VAL from HAVE) 
  group by YEAR,MONTH;
quit;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Mar 2016 12:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257265#M18022</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-17T12:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change SAS Datetime value to Month-Year value?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257297#M18027</link>
      <description>&lt;P&gt;What do you mean it considers the actual date?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc SQL doesn't recognize formats when using Group By, but proc means and proc freq will.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 13:57:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-change-SAS-Datetime-value-to-Month-Year-value/m-p/257297#M18027</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-17T13:57:22Z</dc:date>
    </item>
  </channel>
</rss>

