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

Category: | Date and Time |

Alignment: | Left |

The WEEKVw.
format writes the various formats depending on the specified width.
Algorithm V calculates the SAS date value, with the number-of-the-week
value represented as a decimal number in the range 01–53, with
a leading zero and maximum value of 53. Weeks begin on a Monday and
week 1 of the year is the week that includes both January 4 and the
first Thursday of the year. If the first Monday of January is 2,
3, or 4, the preceding days are part of the last week of the preceding
year. For example, the fifth week of the year would be represented
as 06.

Refer to the following
table for widths, formats, and examples:

The WEEKVw.
format writes the week number as a decimal number in the range 01–53.Weeks
that begin on a Monday and week 1 of the year include January 4 and
the first Thursday of the year. If the first Monday of January is
2, 3, or 4, 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 (with 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

Copyright © SAS Institute Inc. All rights reserved.