<?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 add months in macro variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716499#M221447</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It's not working if I try use it for comparison in where clause as shown below. Code which I used is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Select * from &amp;amp;SYSLAST
where (intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = &amp;amp;REPORTINGDATE | intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = %eval(&amp;amp;REPORTINGDATE.+10000));
quit;
&lt;/PRE&gt;
&lt;P&gt;Value of the macro variable REPORTINGDATE is 20161231 and value of GLOBAL_REPORTINGPERIOD in &amp;amp;SYSLAST is&amp;nbsp;'2017-12'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;359                 (intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = &amp;amp;REPORTINGDATE |
359      ! intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = %eval(&amp;amp;REPORTINGDATE.+10000))
SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
360           ;
NOTE: Table RISK_CUSTOMER created, with 0 rows and 19 columns.
&lt;/PRE&gt;
&lt;P&gt;Appericiate if someone of you help me understand why I'm not getting any records in the output table. Any issues with the where clause?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Really garbage for dealing with dates. And did you read the question I posted earlier about the values you generate can't be used for comparing with actual date values??? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;20161231 is not a date value. The numeric value to use would be 20819 and then use the INTNX function to advance the value one year, NOT date+10000, if you are going to compare to a date such as results from INPUT with a date informat.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;And there is no reason to use %eval in the middle of SQL or Data step calculations in that fashion. You'll get the same result with (&amp;amp;var. + 10000)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I suspect you would likely save yourself a bunch of other headaches by having a version of GLOBAL_REPORTINGPERIOD as a date instead of a character value. You can always assign a format to make the date look like that YYYY-MM string when needed and you don't end up writing &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 15:33:58 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-02-03T15:33:58Z</dc:date>
    <item>
      <title>How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716352#M221373</link>
      <description>&lt;P&gt;I want to add 12 months in the macro variable which has a date value. I tried the code below but it's not producing the desired Output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let reporting_dt=20161231;
%let reporting_dt_new=intnx('month',input(&amp;amp;reporting_dt.,anydtdte7.),12,'E') ;
%put &amp;amp;reporting_dt_new.;
&lt;/PRE&gt;
&lt;P&gt;Excepted Output is, 20171231 for the macro variable "reporting_dt_new"&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 09:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716352#M221373</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2021-02-03T09:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716355#M221374</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let reporting_dt = 20161231;
%let reporting_dt_new = %sysfunc(putn(%sysfunc(intnx(month, %sysfunc(inputn(&amp;amp;reporting_dt., yymmdd8.)), 12, e)), yymmddn8.));
%put &amp;amp;reporting_dt_new;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 09:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716355#M221374</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-03T09:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716358#M221375</link>
      <description>&lt;P&gt;You need to internalize that the macro processor is a &lt;EM&gt;text engine&lt;/EM&gt;, nothing more.&lt;/P&gt;
&lt;P&gt;It will never do any kind of calculation/manipulation &lt;EM&gt;unless you force it to&lt;/EM&gt;, by the use of macro functions.&lt;/P&gt;
&lt;P&gt;Just look at the log:&lt;/P&gt;
&lt;PRE&gt; 75         %put &amp;amp;reporting_dt_new.;
 intnx('month',input(20161231,anydtdte7.),12,'E')
&lt;/PRE&gt;
&lt;P&gt;The %LET will only assign &lt;EM&gt;text&lt;/EM&gt; to the macro variable, no calculated &lt;EM&gt;values&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;To force calculations, use functions like %SYSFUNC or %EVAL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further, if you need to use a value in code (as part of a calculation, or for comparisons), do not format it when storing into a macro variable. Otherwise, you will always have to convert it at the place where you use it. This is covered in Maxim 28.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 10:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716358#M221375</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-03T10:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716359#M221376</link>
      <description>&lt;P&gt;Please describe exactly what you intend to do with a macro variable with a content of 20171231.&lt;/P&gt;
&lt;P&gt;You can't use that to filter or select actual date values&amp;nbsp; in any reasonable manner so I am curious.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 10:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716359#M221376</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-03T10:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716372#M221382</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; said, the macro language is not designed to manipulate data and perform calculations though&lt;/P&gt;
&lt;P&gt;you can use some data step functions through %sysfunc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As shown by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;'s answer, this can lead to rather complex expressions (3 %sysfunc calls) thus making debugging&lt;/P&gt;
&lt;P&gt;more difficult.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using data steps will provide more readable and reliable code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need your value in the form of a macro variable, you still can export the result with a call symput (with maxim 28 in mind).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let reporting_dt=20161231;

data _NULL_;
    reporting_dt=input("&amp;amp;reporting_dt",yymmdd8.);
    reporting_dt_new=intnx('month', reporting_dt,12,'E');

    call symputx("reporting_dt_new", reporting_dt_new);
    call symputx("reporting_dt_new_fmt", put(reporting_dt_new,yymmddn8.));
run;

%put &amp;amp;=reporting_dt_new;
%put &amp;amp;=reporting_dt_new_fmt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 11:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716372#M221382</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2021-02-03T11:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716377#M221387</link>
      <description>%let reporting_dt = 20161231;&lt;BR /&gt;%let reporting_dt_new =%sysfunc(intnx(month,%sysfunc(inputn(&amp;amp;reporting_dt., yymmdd8.)), 12, e), yymmddn8.);&lt;BR /&gt;%put &amp;amp;reporting_dt_new;</description>
      <pubDate>Wed, 03 Feb 2021 11:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716377#M221387</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-02-03T11:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716384#M221392</link>
      <description>%let reporting_dt = 20161231;&lt;BR /&gt;%let reporting_dt_new =%sysfunc(intnx(month,%sysfunc(inputn(&amp;amp;reporting_dt., yymmdd8.)), 12, e), yymmddn8.);&lt;BR /&gt;%put &amp;amp;reporting_dt_new;</description>
      <pubDate>Wed, 03 Feb 2021 11:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716384#M221392</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-02-03T11:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716414#M221413</link>
      <description>&lt;P&gt;Is your starting always going to be the last day of the month?&amp;nbsp; Are you always looking to add exactly 12 months?&amp;nbsp; If so, you can do this simply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let reporting_dt_new = %eval(&amp;amp;reporting_dt + 10000);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only complication you would run into is when the starting date is February 29, so the next year won't actually have a February 29.&amp;nbsp; (Depending on how you intend to use the new date this may or may not be a problem.)&amp;nbsp; At any rate, the more complete solution would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %substr(&amp;amp;reporting_dt, 5) = 0229 %then %let reporting_dt_new = %eval(&amp;amp;reporting_dt + 9999);
%else %let reporting_dt_new = %eval(&amp;amp;reporting_dt + 10000);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716414#M221413</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-02-03T13:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716419#M221415</link>
      <description>Thanks. What would be the value if I want to add only 3 months?&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716419#M221415</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2021-02-03T13:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716420#M221416</link>
      <description>&lt;P&gt;Probably, the first couple of suggestions would be fine.&amp;nbsp; Just change 12 to 3.&amp;nbsp; When I say "probably", I'm noting that you haven't specified what the result should be if your starting point falls in the middle of the month:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;20191215&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716420#M221416</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-02-03T13:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716461#M221430</link>
      <description>&lt;P&gt;It's not working if I try use it for comparison in where clause as shown below. Code which I used is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Select * from &amp;amp;SYSLAST
where (intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = &amp;amp;REPORTINGDATE | intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = %eval(&amp;amp;REPORTINGDATE.+10000));
quit;
&lt;/PRE&gt;
&lt;P&gt;Value of the macro variable REPORTINGDATE is 20161231 and value of GLOBAL_REPORTINGPERIOD in &amp;amp;SYSLAST is&amp;nbsp;'2017-12'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;359                 (intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = &amp;amp;REPORTINGDATE |
359      ! intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = %eval(&amp;amp;REPORTINGDATE.+10000))
SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
360           ;
NOTE: Table RISK_CUSTOMER created, with 0 rows and 19 columns.
&lt;/PRE&gt;
&lt;P&gt;Appericiate if someone of you help me understand why I'm not getting any records in the output table. Any issues with the where clause?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 14:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716461#M221430</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2021-02-03T14:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716467#M221432</link>
      <description>&lt;P&gt;&amp;amp;reportingdate has the raw value, so just apply the INTNX function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let reportingdate=20819;

data test;
GLOBAL_REPORTINGPERIOD = "2017-12";
run;

proc sql;
Select * from test
where (
  intnx('month',input(GLOBAL_REPORTINGPERIOD!!"-01",yymmdd10.),0,'E') = &amp;amp;REPORTINGDATE or
  intnx('month',input(GLOBAL_REPORTINGPERIOD!!"-01",yymmdd10.),0,'E') = intnx('year',&amp;amp;REPORTINGDATE.,1,"e")
  )
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also dislike the ANY type of informats, I rather force the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 14:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716467#M221432</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-03T14:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716468#M221433</link>
      <description>&lt;P&gt;As you can see from these log lines:&lt;/P&gt;
&lt;PRE&gt;SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
&lt;/PRE&gt;
&lt;P&gt;the value in &amp;amp;REPORTINGDATE is not&amp;nbsp;&lt;SPAN&gt;20161231.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 14:48:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716468#M221433</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-03T14:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add months in macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716499#M221447</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It's not working if I try use it for comparison in where clause as shown below. Code which I used is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Select * from &amp;amp;SYSLAST
where (intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = &amp;amp;REPORTINGDATE | intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = %eval(&amp;amp;REPORTINGDATE.+10000));
quit;
&lt;/PRE&gt;
&lt;P&gt;Value of the macro variable REPORTINGDATE is 20161231 and value of GLOBAL_REPORTINGPERIOD in &amp;amp;SYSLAST is&amp;nbsp;'2017-12'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;359                 (intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = &amp;amp;REPORTINGDATE |
359      ! intnx('month',input(GLOBAL_REPORTINGPERIOD ,anydtdte7.),0,'E') = %eval(&amp;amp;REPORTINGDATE.+10000))
SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
SYMBOLGEN:  Macro variable REPORTINGDATE resolves to        20819
360           ;
NOTE: Table RISK_CUSTOMER created, with 0 rows and 19 columns.
&lt;/PRE&gt;
&lt;P&gt;Appericiate if someone of you help me understand why I'm not getting any records in the output table. Any issues with the where clause?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Really garbage for dealing with dates. And did you read the question I posted earlier about the values you generate can't be used for comparing with actual date values??? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;20161231 is not a date value. The numeric value to use would be 20819 and then use the INTNX function to advance the value one year, NOT date+10000, if you are going to compare to a date such as results from INPUT with a date informat.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;And there is no reason to use %eval in the middle of SQL or Data step calculations in that fashion. You'll get the same result with (&amp;amp;var. + 10000)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I suspect you would likely save yourself a bunch of other headaches by having a version of GLOBAL_REPORTINGPERIOD as a date instead of a character value. You can always assign a format to make the date look like that YYYY-MM string when needed and you don't end up writing &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 15:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-months-in-macro-variable/m-p/716499#M221447</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-03T15:33:58Z</dc:date>
    </item>
  </channel>
</rss>

