Hi there,
I have a fairly large dataset (data=have)with dates that spans from April 5, 2021 to December 31, 2022.
I know the SAS date function usually assigns the week number based on the start of the year. However, I was wondering if there was another way to automatically assign a week number to each record in my dataset where 05Apr2021 to 11Apr2021 would be assigned week 1 (not week 0 ), 12Apr2021 to 17Apr2021 would be assigned week 2, and so forth.
Obs ID Date Week
1 1001 05APR2021 1
2 1002 19 APR2021 3
3 2040 01JAN2022
4 7680 08APR2021 2
5 5432 30DEC2022
Thank you!!