Hi, I need to automatically calculate a date in macro variable that corresponds to the 2nd of the following month (i.e. if the code runs in November, the desired date will be 02dec2022). I use this code to get the 2nd of the current month: %let wanted_day=2;
%put &wanted_day;
%let wanted_date=%sysfunc(MDY(%sysfunc(month(%sysfunc(today()))),%sysevalf(&wanted_day.),%sysfunc(year(%sysfunc(today())))),date9.);
%put &wanted_date; Can I change it to shift the month or do I need another approach? Thanks for your help.
... View more