Hello and thanks for your response! My date variable is by MMWR week and I created separate numeric variables for month and year: Proc Format; Value weeks 22045-22051 = "May 10-16 2020" 22052-22058 = "May 17-23 2020" 22059-22065 = "May 24-30 2020" 22066-22072 = "May 31-Jun 6 2020" 22073-22079 = "Jun 7-13 2020" 22080-22086 = "Jun 14-20 2020" 22087-22093 = "Jun 21-27 2020" 22094-22100 = "Jun 28-Jul 4 2020" 22101-22107 = "Jul 5-11 2020" 22108-22114 = "Jul 12-18 2020" 22115-22121 = "Jul 19-25 2020" 22122-22128 = "Jul 26-Aug 1 2020" 22129-22135 = "Aug 2-8 2020" 22136-22142 = "Aug 9-15 2020" 22143-22149 = "Aug 16-22 2020" 22150-22156 = "Aug 23-29 2020" 22157-22163 = "Aug 30-Sep 5 2020" 22164-22170 = "Sep 6-12 2020" 22171-22177 = "Sep 13-19 2020" 22178-22184 = "Sep 20-26 2020" 22185-22191 = "Sep 27-Oct 3 2020" 22192-22198 = "Oct 4-10 2020" 22199-22205 = "Oct 11-17 2020" etc...; value monthfmt 1 = "January" 2 = "February" 3 = "March" 4 = "April" 5 = "May" 6 = "June" 7 = "July" 8 = "August" 9 = "September" 10 = "October" 11 = "November" 12 = "December"; run; . . . if start in (22045:22280) then year=2020; else if start in (22281:22645) then year=2021; else if start in (22646:23012) then year=2022; else if start gt 23012 then year=2023; if start in (22281:22311 , 22645:22675 , 23012:23042) then month=1; else if start in (22312:22339 , 22676:22703 , 23043:23070) then month=2; else if start in (22340:22370 , 22704:22734 , 23071:23101) then month=3; else if start in (22371:22400 , 22735:22764 , 23102:23131) then month=4; etc...; LMK if this helps answer your question. The three lines are three separate calculate numeric variables.
... View more