<?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: Current year in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550764#M8848</link>
    <description>&lt;P&gt;/*Año y mes*/&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('Fetch_M', put(intnx ('month',today(),-2),yymmn6.) );&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put Fetch_M = &amp;amp;Fetch_M.;&lt;/P&gt;&lt;DIV class="mt-info-text"&gt;I have the code that generates me YEAR-MONTH&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;to need current year in format "2019"&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2019 19:44:47 GMT</pubDate>
    <dc:creator>yesidgranadosv</dc:creator>
    <dc:date>2019-04-12T19:44:47Z</dc:date>
    <item>
      <title>Current year</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550760#M8846</link>
      <description>&lt;DIV class="mt-info-text"&gt;I need the current year and save it in a variable %let&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Apr 2019 19:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550760#M8846</guid>
      <dc:creator>yesidgranadosv</dc:creator>
      <dc:date>2019-04-12T19:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Current year</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550761#M8847</link>
      <description>&lt;P&gt;Current year from what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;today()?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;todatetime()?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 19:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550761#M8847</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-12T19:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Current year</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550764#M8848</link>
      <description>&lt;P&gt;/*Año y mes*/&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('Fetch_M', put(intnx ('month',today(),-2),yymmn6.) );&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put Fetch_M = &amp;amp;Fetch_M.;&lt;/P&gt;&lt;DIV class="mt-info-text"&gt;I have the code that generates me YEAR-MONTH&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;to need current year in format "2019"&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 19:44:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550764#M8848</guid>
      <dc:creator>yesidgranadosv</dc:creator>
      <dc:date>2019-04-12T19:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Current year</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550769#M8849</link>
      <description>&lt;P&gt;Are you &lt;STRONG&gt;asking&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;call symputx('Fetch_M', put(intnx ('month',today(),-2),yymmn6.) );&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%put Fetch_M = &amp;amp;Fetch_M.;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%put year=%substr( &amp;amp;Fetch_M.,1,4);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Log&lt;BR /&gt;5 %put Fetch_M = &amp;amp;Fetch_M.;&lt;BR /&gt;Fetch_M = 201902&lt;BR /&gt;&lt;FONT color="#008000"&gt;6 %put year=%substr( &amp;amp;Fetch_M.,1,4);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;year=2019&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;Or in %let&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let year=%substr( &amp;amp;Fetch_M.,1,4);&lt;/P&gt;
&lt;P&gt;%put &amp;amp;=year;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 19:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550769#M8849</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-12T19:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Current year</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550770#M8850</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;great!!!&lt;/P&gt;&lt;P&gt;%let year=%substr( &amp;amp;Fetch_M.,1,4);&lt;/P&gt;&lt;P&gt;%put &amp;amp;=year;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mt-info-text"&gt;But if I want to subtract it 1 or 2 years ago?&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 19:53:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550770#M8850</guid>
      <dc:creator>yesidgranadosv</dc:creator>
      <dc:date>2019-04-12T19:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Current year</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550772#M8851</link>
      <description>&lt;P&gt;Are you asking for &lt;STRONG&gt;this&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;call symputx('Fetch_M', put(intnx ('month',today(),-2),yymmn6.) );&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%put Fetch_M = &amp;amp;Fetch_M.;&lt;/P&gt;
&lt;P&gt;%let year=%substr( &amp;amp;Fetch_M.,1,4);&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%let subtracted_year=%eval(&amp;amp;year-2);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%put &amp;amp;=subtracted_year;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 19:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550772#M8851</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-12T19:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Current year</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550782#M8852</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let currentYear = %sysfunc(today(), year4.);
%put &amp;amp;currentYear.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TODAY() returns todays date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%SYSFUNC() takes two parameter, a SAS function (TODAY()) and the format used. YEAR4 converts it to the year.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 20:54:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Current-year/m-p/550782#M8852</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-12T20:54:10Z</dc:date>
    </item>
  </channel>
</rss>

