Reads a value in the form a week-number within a year and returns a SAS date value using the V algorithm.

Category: | Date and Time |

The WEEKVw.
informat reads the week-number value within a year. If the input does
not contain a year expression, WEEKVw.
uses the current year as the year expression, which is the default.
If the input does not contain a day expression, WEEKVw.
uses the first day of the week as the day expression, which is the
default.

The V algorithm calculates
the SAS date value. The number-of-week value is represented as a decimal
number in the range 01–53, with a leading zero and a maximum
value of 53. Weeks begin on a Monday, and week 1 of the year is the
week that includes 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.

The inputs to the WEEKVw.
informat are the same date for the following example. The current
year is 2012.

The WEEKVw.
informat reads the week-number value as a decimal number in the range
01–53, with Monday as the first day of the week. Week 1 of
the year is the week that includes 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 WEEKUw.
informat reads the week-number value as a decimal number in the range
0–53, with Sunday as the first day of the week.

The WEEKWw.
informat reads the week-number-of-year value as a decimal number in
the range 00–53, with Monday as the first day of week.

Functions:

WEEK Function in SAS Functions and CALL Routines: Reference

Copyright © SAS Institute Inc. All rights reserved.