Hello,
As @Kurt_Bremser said, the macro language is not designed to manipulate data and perform calculations though
you can use some data step functions through %sysfunc.
As shown by @PeterClemmensen's answer, this can lead to rather complex expressions (3 %sysfunc calls) thus making debugging
more difficult.
Using data steps will provide more readable and reliable code.
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).
%let reporting_dt=20161231;
data _NULL_;
reporting_dt=input("&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 &=reporting_dt_new;
%put &=reporting_dt_new_fmt;
... View more