<?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 How to identify prev month's year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-prev-month-s-year/m-p/296096#M61954</link>
    <description>I want a sas logic to identify previous month's year. For example, 1. if current month year JAN 2016 then I need to retrieve 2015 2. if current month year FEB 2016 then I need to retrieve 2016</description>
    <pubDate>Fri, 02 Sep 2016 11:22:03 GMT</pubDate>
    <dc:creator>jayakumarmm</dc:creator>
    <dc:date>2016-09-02T11:22:03Z</dc:date>
    <item>
      <title>How to identify prev month's year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-prev-month-s-year/m-p/296096#M61954</link>
      <description>I want a sas logic to identify previous month's year. For example, 1. if current month year JAN 2016 then I need to retrieve 2015 2. if current month year FEB 2016 then I need to retrieve 2016</description>
      <pubDate>Fri, 02 Sep 2016 11:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-prev-month-s-year/m-p/296096#M61954</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-02T11:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify prev month's year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-prev-month-s-year/m-p/296102#M61958</link>
      <description>&lt;P&gt;Is your variable a SAS date, ie numeric with a date format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so this should work, I split it up for clarity but you can nest your functions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Prev_Month = INTNX('month', date_var, -1, 'B');
Prev_Year = year(Prev_Month);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 13:22:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-prev-month-s-year/m-p/296102#M61958</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-02T13:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify prev month's year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-identify-prev-month-s-year/m-p/296112#M61964</link>
      <description>&lt;P&gt;Using some of Reeza's code but adding 'Today' function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Prev_months_year = year(INTNX('month', today(), -1, 'B'));&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 13:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-identify-prev-month-s-year/m-p/296112#M61964</guid>
      <dc:creator>set_all__</dc:creator>
      <dc:date>2016-09-02T13:45:33Z</dc:date>
    </item>
  </channel>
</rss>

