I have a data table with 1 variable classified by date. I would like to use a function to change the date format so that it complies with the ISO 8601 calendar week. Example follows:
Date------SAS Format--ISO 8601
2011/1/3--18630-------2011CW0101
2011/1/4--18631-------2011CW0102
2011/1/5--18632-------2011CW0103
2011/1/6--18633-------2011CW0104
2011/1/7--18634-------2011CW0105
2011/1/8--18635-------2011CW0106
2011/1/9--18636-------2011CW0107
(the dashes inserted above are for clarity only)
The above series progresses on until the last day of 2011 calendar year on 01JAN2012, or 2011CW5207.
I searched through the forum and SAS community and couldn’t find any reference to this type of a date/time function.
THe WEEKV format suggestion put me in the right direction. In combination with the WEEK(date,'v') function I was able to display dates and sum quantities based on the Mon - Sun calendar week system.