You can try something like this, I wasn't sure what you wanted if the date did not meet your criteria. %let tday = %sysfunc(today()); %macro custom; %global custom1 custom2 custom3 custom4 custom5 custom6 custom7 sat1 sat2; data _null_; custom1='03feb2018'd; custom2='10apr2018'd; custom3='15may2018'd; custom4='23jul2018'd; custom5='30aug2018'd; custom6='19oct2018'd; custom7='21dec2018'd; sat1=intnx('week',intnx('month',&tday,-0,'begin'),+0,'end'); sat2=intnx('week',intnx('month',&tday,-0,'begin'),+1,'end'); call symput('custom1',put(custom1,mmddyy10.)); call symput('custom2',put(custom2,mmddyy10.)); call symput('custom3',put(custom3,mmddyy10.)); call symput('custom4',put(custom4,mmddyy10.)); call symput('custom5',put(custom5,mmddyy10.)); call symput('custom6',put(custom6,mmddyy10.)); call symput('custom7',put(custom7,mmddyy10.)); call symput('sat1',put(sat1,mmddyy10.)); call symput('sat2',put(sat2,mmddyy10.)); %mend custom; %custom; run; data xxxx; input date date9.; datalines; 03may2018 06may2018 08jul2018 19oct2018 30aug2018 31aug2018 ; data zzzz (drop=q cust); set xxxx; q=0; if weekday(date)=1 then q+1; do cust="&custom1","&custom2","&custom3","&custom4","&custom5","&custom6","&custom7","&sat1","&sat2"; if input(cust,mmddyy10.)=date then q+1; end; if q>0 then new_date=intnx('weekday',date,+1); else new_date=intnx('weekday',date,+1); run; proc print data=zzzz; format date new_date mmddyy10.; run; Obs date new_date Obs date new_date 1 05/03/2018 05/04/2018 2 05/06/2018 05/07/2018 3 05/30/2018 05/31/2018 4 07/08/2018 07/09/2018 5 10/19/2018 10/22/2018 6 08/30/2018 08/31/2018 7 08/31/2018 09/03/2018 Ignore below...not sure how to remove 1 05/03/2018 . 2 05/06/2018 05/07/2018 3 07/08/2018 07/09/2018 4 10/19/2018 10/22/2018 5 08/30/2018 08/31/2018 6 08/31/2018 .
... View more