Writes a week number in decimal format by using
the W algorithm.

Category: | Date and Time |

Alignment: | left |

The WEEKWw. format writes the various formats depending
on the specified width. Algorithm W calculates the SAS date value
using the number of the week within the year (Monday is considered
the first day of the week). The number-of-the-week value is represented
as a decimal number in the range 0–53, with a leading zero
and maximum value of 53. For example, the fifth week of the year would
be represented as 05.

The WEEKVw. format writes the week number as a decimal
number in the range 01–53. Weeks beginning on a Monday and
on week 1 of the year include both January 4th and the first Thursday
of the year. If the first Monday of January is the 2nd, 3rd, or 4th,
the preceding days are part of the last week of the preceding year.
The WEEKWw. format writes the
week number of the year as a decimal number in the range 00–53,
with Monday as the first day of week 1. The WEEKUw. format writes the week number of the year
(Sunday as the first day of the week) as a decimal number in the range
0–53, with a leading zero.

Functions:

WEEK Function in SAS Functions and CALL Routines: Reference