<?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: get the last day of a week in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402686#M97818</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170715"&gt;@madix&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp.PNG" style="width: 210px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15748iC280BF5D2AAF6B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp.PNG" alt="sashelp.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp2.PNG" style="width: 178px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15749i4E9AC71CDE74C521/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp2.PNG" alt="sashelp2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you for your quick reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a problem. Each time I try the function weekday() on a date like 10/10/2017, it gives me the number 6. Do you know why?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ouch. When you do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;a = weekday(11/02/2017);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you create a value of 10 divided by 2 divided by 2017, which is considerably less than 1, so you get the date of SAS day zero, which was 01jan1960, a Friday (weekday 6).&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 11:40:06 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-10-10T11:40:06Z</dc:date>
    <item>
      <title>get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402662#M97812</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone could help me it will be great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is the following one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table (one column is date and the other one is rate). I would like to&amp;nbsp;keep only the line with the last day of the week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp.PNG" style="width: 159px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15739iF8F7ADDD36F8FA9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp.PNG" alt="sashelp.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;here is my table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone could help me.. thank you&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402662#M97812</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-10T11:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402663#M97813</link>
      <description>&lt;P&gt;Use the weekday() function, either in a where condition or a subsetting if:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
where weekday(date) = X;
/* alternatively: */
if weekday(date) = X;
/* insert a suiting number for X, according to what you define as the last day of the week */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402663#M97813</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-10T11:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402664#M97814</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;&lt;BR /&gt; set have;&lt;BR /&gt; where date=intnx('week.2',date,0,'end');&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402664#M97814</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-10-10T11:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402681#M97815</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp.PNG" style="width: 210px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15748iC280BF5D2AAF6B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp.PNG" alt="sashelp.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp2.PNG" style="width: 178px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15749i4E9AC71CDE74C521/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp2.PNG" alt="sashelp2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem. Each time I try the function weekday() on a date like 10/10/2017, it gives me the number 6. Do you know why?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402681#M97815</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-10T11:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402682#M97816</link>
      <description>&lt;P&gt;To specify a Date value, you have to express it with a date literal:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a = weekday('02Oct2017'd);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your example, SAS evaluates the expression as 10 divided by 12 divided by 2017 (10/12/2017).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402682#M97816</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-10-10T11:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402686#M97818</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170715"&gt;@madix&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp.PNG" style="width: 210px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15748iC280BF5D2AAF6B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp.PNG" alt="sashelp.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp2.PNG" style="width: 178px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15749i4E9AC71CDE74C521/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp2.PNG" alt="sashelp2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you for your quick reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a problem. Each time I try the function weekday() on a date like 10/10/2017, it gives me the number 6. Do you know why?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ouch. When you do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;a = weekday(11/02/2017);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you create a value of 10 divided by 2 divided by 2017, which is considerably less than 1, so you get the date of SAS day zero, which was 01jan1960, a Friday (weekday 6).&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402686#M97818</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-10T11:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402723#M97822</link>
      <description>&lt;P&gt;Thanks a lot! it finally works!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 12:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402723#M97822</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-10T12:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402812#M97856</link>
      <description>&lt;P&gt;Still in my table, I wonder how to get&amp;nbsp;a line where there is the&amp;nbsp;last day of a month. Can someone help me ?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sashelp.PNG" style="width: 168px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15750i5E40FC2CFB0D9E3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="sashelp.PNG" alt="sashelp.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;For example in this table, I would like to keep the line where there is 03/31/2005 and all the other&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402812#M97856</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-10T15:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402823#M97859</link>
      <description>&lt;P&gt;The &lt;A href="http://go.documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p10v3sa3i4kfxfn1sovhi5xzxh8n.htm&amp;amp;locale=en" target="_self"&gt;INTNX function&lt;/A&gt; has a treasure trove of these types of calculations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* true when the date is the same as EOM date */
where date =&amp;nbsp;intnx('month',&amp;nbsp;date, 1, 'e');&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 16:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/402823#M97859</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-10-10T16:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403127#M97948</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The thing is that I would like to keep only&amp;nbsp;the line with the last day of the month in my date. In my own case I will have to keep the line with the following date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;03/31/2005&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;04/29/2005&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;05/31/2005&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403127#M97948</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-11T12:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403131#M97950</link>
      <description>&lt;P&gt;The solution works well, but it avoid the date 04/29/2005 which is in my list. It doesn't take&amp;nbsp;my last date of&amp;nbsp;each&amp;nbsp;month that I have&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:39:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403131#M97950</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-11T12:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403135#M97951</link>
      <description>&lt;P&gt;So you mean to have the last &lt;EM&gt;work&lt;/EM&gt;day of a month, excluding Saturdays and Sundays? What about holidays?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403135#M97951</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-11T12:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403140#M97952</link>
      <description>&lt;P&gt;&amp;nbsp;I realise my problem is a bit more complicated than I thought:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1/ I don't need the last day of a week but I need the last day of the week which is in my set of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So sometimes, instead of taking friday, I will take thursday because friday is not the last day of the week I have in my data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Saturday and sunday doesn't matter here I would say because I don't have any data at those date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2/Then I would like to do the same by taking the last day of the month in my data and not the last day of a month in general.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403140#M97952</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-11T13:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403151#M97955</link>
      <description>&lt;P&gt;First, assign a group variable to your data that references the week; you can use the week() function for that.&lt;/P&gt;
&lt;P&gt;Then, find the max(date) within each week.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
format mydate yymmddd10.;
x = 0;
do mydate = today() - 20 to today();
  x + 1;
  if weekday(mydate) not in (6,7) then output;
end;
run;

proc sql;
create table want as
select
  mydate, x, week(mydate) as week
from have
group by week
having mydate = max(mydate);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403151#M97955</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-11T13:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403159#M97958</link>
      <description>&lt;P&gt;As an addendum to my previous post: if your data spans more than one year, you need to create a compound variable (year and week number) to reliably identify a week.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403159#M97958</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-11T13:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403161#M97959</link>
      <description>&lt;P&gt;I don't understand this part:&lt;/P&gt;&lt;P&gt;do mydate &lt;SPAN class="token operator"&gt;&lt;FONT color="#a67f59"&gt;=&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;&lt;FONT color="#0000ff"&gt;today&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#999999"&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/FONT&gt; &lt;SPAN class="token operator"&gt;&lt;FONT color="#a67f59"&gt;-&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; to &lt;SPAN class="token function"&gt;&lt;FONT color="#0000ff"&gt;today&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#999999"&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;why do we use this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;should I replace today() by something?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403161#M97959</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-11T13:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403172#M97960</link>
      <description>&lt;P&gt;my date is taking many year like 2000 to 2017 by the way&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 14:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403172#M97960</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-10-11T14:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: get the last day of a week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403309#M97998</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/170715"&gt;@madix&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I don't understand this part:&lt;/P&gt;
&lt;P&gt;do mydate &lt;SPAN class="token operator"&gt;&lt;FONT color="#a67f59"&gt;=&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;&lt;FONT color="#0000ff"&gt;today&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#999999"&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/FONT&gt; &lt;SPAN class="token operator"&gt;&lt;FONT color="#a67f59"&gt;-&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; to &lt;SPAN class="token function"&gt;&lt;FONT color="#0000ff"&gt;today&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#999999"&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;why do we use this?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;should I replace today() by something?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;I just created 20 dates for testing, that's all.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 18:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-the-last-day-of-a-week/m-p/403309#M97998</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-11T18:47:28Z</dc:date>
    </item>
  </channel>
</rss>

