<?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: MONTH function not working properly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402197#M97646</link>
    <description>&lt;P&gt;This is spot on &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;. I bet my left arm you are correct. It also illustrates the danger to assume that some function is "not working properly". One does SAS more justice by stating that something is "not behaving as expected" which leaves some room for user error. Month() is ancient. It was in V5.08 when I started. It has gone through some proper testing by now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If only I got a eurocent for every time a user called me to tell me that they found a bug....&lt;/P&gt;</description>
    <pubDate>Sun, 08 Oct 2017 17:14:03 GMT</pubDate>
    <dc:creator>jklaverstijn</dc:creator>
    <dc:date>2017-10-08T17:14:03Z</dc:date>
    <item>
      <title>MONTH function not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402195#M97644</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to create a variable which extract the month from a other existing variable, but the results does not represent reality.&lt;/P&gt;&lt;P&gt;DATA NEW;&lt;BR /&gt;&amp;nbsp;set work.new;&lt;BR /&gt;&amp;nbsp;MOIS=MONTH(DATERELEVE);&lt;BR /&gt;&amp;nbsp;RUN;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15699i344AA887B99B4687/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS.PNG" alt="SAS.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: The data is imported from a xlsx files.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 16:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402195#M97644</guid>
      <dc:creator>KTR44</dc:creator>
      <dc:date>2017-10-08T16:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: MONTH function not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402196#M97645</link>
      <description>&lt;P&gt;The MONTH() function should work fine, but it won't return a string. It will return the number of the month.&lt;/P&gt;
&lt;PRE&gt;216   data test;
217    date=today();
218    format date date9.;
219    month=month(date);
220    put date= month=;
221   run;

date=08OCT2017 month=10
&lt;/PRE&gt;
&lt;P&gt;Perhaps you tried to attach the MONNAME. format to your new month number variable? If so then it should show JANUARY for every value since MONNAME is meant to be used with dates and the date values of 1 to 12 are all in January of 1960.&lt;/P&gt;
&lt;PRE&gt;261   data _null_;
262    do month=1 to 12;
263      put month= 'date9=' month date9. ' monname=' month monname.;
264    end;
265   run;

month=1 date9=02JAN1960 monname=  January
month=2 date9=03JAN1960 monname=  January
month=3 date9=04JAN1960 monname=  January
month=4 date9=05JAN1960 monname=  January
month=5 date9=06JAN1960 monname=  January
month=6 date9=07JAN1960 monname=  January
month=7 date9=08JAN1960 monname=  January
month=8 date9=09JAN1960 monname=  January
month=9 date9=10JAN1960 monname=  January
month=10 date9=11JAN1960 monname=  January
month=11 date9=12JAN1960 monname=  January
month=12 date9=13JAN1960 monname=  January
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 17:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402196#M97645</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-10-08T17:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: MONTH function not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402197#M97646</link>
      <description>&lt;P&gt;This is spot on &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;. I bet my left arm you are correct. It also illustrates the danger to assume that some function is "not working properly". One does SAS more justice by stating that something is "not behaving as expected" which leaves some room for user error. Month() is ancient. It was in V5.08 when I started. It has gone through some proper testing by now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If only I got a eurocent for every time a user called me to tell me that they found a bug....&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 17:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402197#M97646</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-10-08T17:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: MONTH function not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402199#M97647</link>
      <description>&lt;P&gt;Ok thanks a lot!&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 17:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MONTH-function-not-working-properly/m-p/402199#M97647</guid>
      <dc:creator>KTR44</dc:creator>
      <dc:date>2017-10-08T17:29:47Z</dc:date>
    </item>
  </channel>
</rss>

