<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to calculate the week of the year! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117351#M259444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what version of SAS are you using and what was the error?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2012 21:43:48 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-09-10T21:43:48Z</dc:date>
    <item>
      <title>How to calculate the week of the year!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117348#M259441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guru's;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a SAS date and want to convert it to week day of the year (for mulitple years).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example 08JAN2009 show as '2 week of 2009'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody please advise?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 21:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117348#M259441</guid>
      <dc:creator>Rish</dc:creator>
      <dc:date>2012-09-10T21:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the week of the year!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117349#M259442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the week function.&amp;nbsp; i.e.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WEEK( &lt;EM&gt;date&lt;/EM&gt; &lt;EM&gt;&amp;lt;, &lt;/EM&gt;'descriptor'&lt;/STRONG&gt;&amp;gt; )&lt;/P&gt;&lt;P style="margin: 0px 0px 1.4em;"&gt;&lt;A class="syntaxindex" id="etsug.intervals.a0000000065" style="font-family: inherit;"&gt;&lt;/A&gt;returns the week of year from a SAS date value. The algorithm used to calculate the week depends on the descriptor.&lt;/P&gt;&lt;P style="margin: 0px 0px 1.4em;"&gt;If the descriptor is 'U,' weeks start on Sunday and the range is &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0039.png" style="font-family: inherit;" /&gt; to &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0040.png" style="font-family: inherit;" /&gt;. If weeks &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0039.png" style="font-family: inherit;" /&gt; and &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0040.png" style="font-family: inherit;" /&gt; exist, they are only partial weeks. Week 52 can be a partial week.&lt;/P&gt;&lt;P style="margin: 0px 0px 1.4em;"&gt;If the descriptor is 'V', the result is equivalent to the ISO 8601 week of year definition. The range is &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0003.png" style="font-family: inherit;" /&gt; to &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0040.png" style="font-family: inherit;" /&gt;. Week &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0040.png" style="font-family: inherit;" /&gt; is a leap week. The first week of the year, Week &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0003.png" style="font-family: inherit;" /&gt;, and the last week of the year, Week &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0041.png" style="font-family: inherit;" /&gt; or &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0040.png" style="font-family: inherit;" /&gt;, can include days in another Gregorian calendar year.&lt;/P&gt;&lt;P style="margin: 0px 0px 1.4em;"&gt;If the descriptor is 'W', weeks start on Monday and the range is &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0039.png" style="font-family: inherit;" /&gt; to &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0040.png" style="font-family: inherit;" /&gt;. If weeks &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0039.png" style="font-family: inherit;" /&gt; and &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0040.png" style="font-family: inherit;" /&gt; exist, they are only partial weeks. Week 52 can be a partial week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 21:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117349#M259442</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-09-10T21:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the week of the year!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117350#M259443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arthur -&lt;/P&gt;&lt;P&gt;Tried to run the below code - giving error. Any advise please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data xyz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set web.pmrate (keep= customer datefield);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; week(datefield, 'v');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 21:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117350#M259443</guid>
      <dc:creator>Rish</dc:creator>
      <dc:date>2012-09-10T21:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the week of the year!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117351#M259444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what version of SAS are you using and what was the error?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 21:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117351#M259444</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-09-10T21:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the week of the year!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117352#M259445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arthur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following is the information:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS 9.2 version 4.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error: undeclared array referenced; week.&lt;/P&gt;&lt;P&gt;error 22-322: syntax error, expecting one of the following: +, =.&lt;/P&gt;&lt;P&gt;error 76-322: syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Thanks&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 21:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117352#M259445</guid>
      <dc:creator>Rish</dc:creator>
      <dc:date>2012-09-10T21:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the week of the year!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117353#M259446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I just noticed your code.&amp;nbsp; You never stipulated a variable for SAS to create.&amp;nbsp; Try something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data xyz;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set web.pmrate (keep= customer datefield);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; week=week(datefield, 'v');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 22:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-week-of-the-year/m-p/117353#M259446</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-09-10T22:48:31Z</dc:date>
    </item>
  </channel>
</rss>

