We have a scheduled task running each Monday morning setting start and stop date to the dates of the previous week, week starting Mondays For example when running on 4'th January 2021 it sets the start and stop date to 28Dec2020 and 03 Jan2021 as follows: %LET STARTDATE = %sysfunc(intnx(DAY,(%sysfunc(intnx(WEEK,(%SYSFUNC(today(),)),-1,b),)),+1),date9.); %PUT &STARTDATE; %LET STOPDATE = %sysfunc(intnx(DAY,(%sysfunc(intnx(WEEK,(%SYSFUNC(today(),)),-1,e),)),+1),date9.); %PUT &STOPDATE; We set another macro variable to the corresponding week number With this year 2020/2021 we don't seem to be able to get the week number right (=53) using the intnx function ... %LET WEEK = %sysfunc(intnx(WEEK,(%SYSFUNC(today(),)),0),weeku3.); Please suggest solution which would set the week number for running on 04Jan2021 to '53' and on 11Jan2021 to '01' Thanks
... View more