<?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: Determine the week number of a month in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408108#M12443</link>
    <description>&lt;P&gt;Here's a different way to calculate WEEK:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;week = ceil(day(_datadate)/7);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you know that your data set contains only Fridays, you could easily follow that with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if week = 3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your data set might contain some non-Fridays, you would have to add a condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if week = 3 and weekday(_datadate)=6;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 17:02:31 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-10-27T17:02:31Z</dc:date>
    <item>
      <title>Determine the week number of a month</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408105#M12441</link>
      <description>&lt;P&gt;Hi guys&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable called "_datadate" that include all Friday from May 2015 to May 2017, I want to output all Friday which is 3rd Friday in the month, I use this code "&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA AAPL_TEsT1;&lt;BR /&gt;set AAPL_test;&lt;BR /&gt;week =intck('_datadate',intnx('month',date,0),date)+1;&lt;BR /&gt;run; "&lt;/P&gt;&lt;P&gt;But it not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some suggestions for this issue.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 16:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408105#M12441</guid>
      <dc:creator>Xinhui</dc:creator>
      <dc:date>2017-10-27T16:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the week number of a month</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408106#M12442</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you need to calculate for weekday&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201173.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201173.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;if week = 3 and weekday = 6&lt;/P&gt;
&lt;P&gt;will give your 3rd Friday of everymonth&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 16:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408106#M12442</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-10-27T16:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the week number of a month</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408108#M12443</link>
      <description>&lt;P&gt;Here's a different way to calculate WEEK:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;week = ceil(day(_datadate)/7);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you know that your data set contains only Fridays, you could easily follow that with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if week = 3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your data set might contain some non-Fridays, you would have to add a condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if week = 3 and weekday(_datadate)=6;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408108#M12443</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-27T17:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the week number of a month</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408110#M12444</link>
      <description>&lt;P&gt;solve my problem！！！！ thank you very much!!!!!!!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408110#M12444</guid>
      <dc:creator>Xinhui</dc:creator>
      <dc:date>2017-10-27T17:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Determine the week number of a month</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408112#M12445</link>
      <description>&lt;P&gt;NWKDOM() may be easier to work with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Returns the date for the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;n&lt;/SPAN&gt;&lt;SPAN&gt;th occurrence of a weekday for the specified month and year.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Determine-the-week-number-of-a-month/m-p/408112#M12445</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-27T17:12:44Z</dc:date>
    </item>
  </channel>
</rss>

