<?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 Macro statement for previous year or next year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-statement-for-previous-year-or-next-year/m-p/911682#M359486</link>
    <description>&lt;P&gt;The following statement is for current year&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Yr = %sysfunc(Year(%sysfunc(today())));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What would be the statement for previous year or next year?&lt;/P&gt;
&lt;P&gt;I tried the statement below, but did not work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let PrevYr = %sysfunc(Year(%sysfunc(today())))-1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Jan 2024 18:04:05 GMT</pubDate>
    <dc:creator>Barkat</dc:creator>
    <dc:date>2024-01-16T18:04:05Z</dc:date>
    <item>
      <title>Macro statement for previous year or next year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-statement-for-previous-year-or-next-year/m-p/911682#M359486</link>
      <description>&lt;P&gt;The following statement is for current year&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Yr = %sysfunc(Year(%sysfunc(today())));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What would be the statement for previous year or next year?&lt;/P&gt;
&lt;P&gt;I tried the statement below, but did not work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let PrevYr = %sysfunc(Year(%sysfunc(today())))-1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2024 18:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-statement-for-previous-year-or-next-year/m-p/911682#M359486</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2024-01-16T18:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro statement for previous year or next year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-statement-for-previous-year-or-next-year/m-p/911683#M359487</link>
      <description>&lt;P&gt;If you want the macro processor to preform arithmetic you have to ask it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%EVAL() will do integer arithmetic, which is all you need.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let PrevYr = %eval(&amp;amp;yr-1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need floating point values use %SYSEVALF().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 18:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-statement-for-previous-year-or-next-year/m-p/911683#M359487</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-16T18:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro statement for previous year or next year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-statement-for-previous-year-or-next-year/m-p/911684#M359488</link>
      <description>Wonderful!!!!!!!!!!!!</description>
      <pubDate>Tue, 16 Jan 2024 18:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-statement-for-previous-year-or-next-year/m-p/911684#M359488</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2024-01-16T18:16:54Z</dc:date>
    </item>
  </channel>
</rss>

