Hello everyone,
I want to increment a value from the number 13.
In my case, the number 13 means "September2017".
I want to increment this number by 1 for each additional month (14 for October2017, 15 for November2017, 16 for December2017, 17 for January2018 and so on...).
For example, if I want the number 14, I tried the following code :
%let Initial_Month='01SEP2017'd; /*Fixed value*/
%let Day=%sysfunc(intnx(month, %sysfunc(today()), -1), DATE9.);
%let Actual_Month= 13 + %sysfunc(intck('month', &Initial_Month. , &Day.));
But I got the following error :
ERROR: Argument 3 to function INTCK referenced by the %SYSFUNC or %QSYSFUNC macro function is not a number.
ERROR: Invalid arguments detected in %SYSCALL, %SYSFUNC, or %QSYSFUNC argument list. Execution of %SYSCALL statement or %SYSFUNC
or %QSYSFUNC function reference is terminated.
I'm also opened to solutions using Data steps, the point is just to get a macro variable with an autoincremental value 14.
Thank you in advance for your help !
Best regards,