<?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 to identify previous month full name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-previous-month-full-name/m-p/296123#M61968</link>
    <description>&lt;P&gt;You can use monname format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;month_name=PUT(date,monname.); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But be aware that this takes a date value as input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; font-size: small; line-height: 15px; white-space: pre;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;format prev_month $20.;&lt;BR /&gt;Prev_month = put((INTNX('month', today(), -1, 'B')),monname.);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2016 14:16:22 GMT</pubDate>
    <dc:creator>set_all__</dc:creator>
    <dc:date>2016-09-02T14:16:22Z</dc:date>
    <item>
      <title>How to identify previous month full name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-previous-month-full-name/m-p/296119#M61966</link>
      <description>&lt;P&gt;I want to identify previous month full name .i.e. If current month is September then I want to retrieve August. Currently I am going with the below approach but this will fail for the month January. Please assist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;month = month(input("&amp;amp;sysdate9",date9.));
lastmonth = int(month) - 1;
put(lastmonth,nlstrmon.);&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-previous-month-full-name/m-p/296119#M61966</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-02T14:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify previous month full name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-previous-month-full-name/m-p/296123#M61968</link>
      <description>&lt;P&gt;You can use monname format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;month_name=PUT(date,monname.); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But be aware that this takes a date value as input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; font-size: small; line-height: 15px; white-space: pre;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;format prev_month $20.;&lt;BR /&gt;Prev_month = put((INTNX('month', today(), -1, 'B')),monname.);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-previous-month-full-name/m-p/296123#M61968</guid>
      <dc:creator>set_all__</dc:creator>
      <dc:date>2016-09-02T14:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify previous month full name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-previous-month-full-name/m-p/296134#M61971</link>
      <description>&lt;P&gt;Since you have nearly working code, you could tweak it simply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if month = 1 then lastmonth = 12;&lt;/P&gt;
&lt;P&gt;else lastmonth = month - 1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you wanted to get into the depths of how SAS works with dates, you could modify your first statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;lastmonth = month( intnx('month', "&amp;amp;sysdate9"d, -1));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As before, that gives you the month number which still has be to converted to the name.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 15:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-previous-month-full-name/m-p/296134#M61971</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-02T15:01:30Z</dc:date>
    </item>
  </channel>
</rss>

