<?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: where start_date1&amp;gt;=(today()-weekday(today())+2) - 7*156     ---   ?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320466#M70599</link>
    <description>&lt;PRE&gt;today()-weekday(today())+2&lt;/PRE&gt;
&lt;P&gt;normalizes today's date to the last preceding Tuesday. Then 156 weeks are subtracted, which corresponds to rougly three years.&lt;/P&gt;
&lt;P&gt;So it translates to "last Tuesday, three years ago".&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2016 10:56:12 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-12-21T10:56:12Z</dc:date>
    <item>
      <title>where start_date1&gt;=(today()-weekday(today())+2) - 7*156     ---   ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320459#M70598</link>
      <description>&lt;P&gt;Hi, I am new to SAS. I am trying to understand what the below code does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where start_date1&amp;gt;=(today()-weekday(today())+2) - 7*156&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandeepgnv&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 10:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320459#M70598</guid>
      <dc:creator>sandeepgnv</dc:creator>
      <dc:date>2016-12-21T10:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: where start_date1&gt;=(today()-weekday(today())+2) - 7*156     ---   ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320466#M70599</link>
      <description>&lt;PRE&gt;today()-weekday(today())+2&lt;/PRE&gt;
&lt;P&gt;normalizes today's date to the last preceding Tuesday. Then 156 weeks are subtracted, which corresponds to rougly three years.&lt;/P&gt;
&lt;P&gt;So it translates to "last Tuesday, three years ago".&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 10:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320466#M70599</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-21T10:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: where start_date1&gt;=(today()-weekday(today())+2) - 7*156     ---   ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320467#M70600</link>
      <description>&lt;P&gt;Code is going 3 years back by using factor 7*156 &amp;nbsp;i.e. 7 * (3*52). It is kind of very unusual way to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(today()-weekday(today())+2) is kind of finding last&amp;nbsp;Monday from current date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try to use below code to debug it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;data temp;
format v1 v2  date9.;
v1=(today()-weekday(today())+2) - 7*156;
v2=(today()-weekday(today())+2);
v3=weekday(today());
v4=7*156;
v5=weekday(today())+2;
put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 11:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320467#M70600</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-12-21T11:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: where start_date1&gt;=(today()-weekday(today()) 2) - 7*156 --- ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320468#M70601</link>
      <description>That was really quick &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Many Thanks KurtBremser !!&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Wed, 21 Dec 2016 11:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320468#M70601</guid>
      <dc:creator>sandeepgnv</dc:creator>
      <dc:date>2016-12-21T11:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: where start_date1&gt;=(today()-weekday(today())+2) - 7*156     ---   ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320471#M70603</link>
      <description>&lt;P&gt;&lt;STRONG&gt;today()&lt;/STRONG&gt; function enters the system date into a variable.&lt;/P&gt;
&lt;P&gt;Today you will get the DEC 12th, 2016 given in a sas date.&lt;/P&gt;
&lt;P&gt;The sas date contains the number of days since JAN 1st, 1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;weekday()&lt;/STRONG&gt; function gives the day number in a week, IE:&lt;/P&gt;
&lt;P&gt;1=sunday, 2=monday etc. or 1=monday, 2=tuesday, etc. - depending on your sas system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Youe expression:&lt;STRONG&gt; where&amp;nbsp;start_date1&amp;gt;=(today()-weekday(today())+2) - 7*156&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;means: check variable&amp;nbsp;&lt;STRONG&gt;start_date1&lt;/STRONG&gt; is it greater or equal to the calculated date&lt;/P&gt;
&lt;P&gt;(today - 4 (=wednsday) + 2) - 7*156.&lt;/P&gt;
&lt;P&gt;To unswer, why is such calculation, you need ask the one who gave it to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 11:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320471#M70603</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-21T11:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: where start_date1&gt;=(today()-weekday(today())+2) - 7*156     ---   ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320509#M70611</link>
      <description>&lt;P&gt;This type of calculation dosen't give accurate value. Since 1 year ^= 365 days or 1 year ^= 52 weeks.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 14:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-start-date1-gt-today-weekday-today-2-7-156/m-p/320509#M70611</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-12-21T14:31:25Z</dc:date>
    </item>
  </channel>
</rss>

