My question is as follows - I have a code that adds one month to the macro variable and the code works fine:
%let month=1;
%let act_dt = %sysfunc(MDY(&month,1,2016));
%let x_akt=%sysfunc(intnx(MONTH,&act_dt,1),yymmdd10.);
%put current month: &act_dt;
%put plus one month: &x_akt;
giving me the output:
current month: 20454
plus one month: 2016-02-01
But if I add a type of format to the first macro variable, then the function intnx does not work properly.
%let month=1;
%let act_dt = %sysfunc(MDY(&month,1,2016),yymmdd10.);
%let x_akt=%sysfunc(intnx(MONTH,&act_dt,1),yymmdd10.);
%put current month: &act_dt;
%put plus one month: &x_akt;
with the outcome:
current month: 2016-01-01
27 %put plus one month: &x_akt;
plus one month: 1965-08-01
Thank you for any advice, why is it like that and if there is a way how to present both macro variables in the same format.