<?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 Determing dates of previous Monday and Sunday in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193229#M48515</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I have a report I run where I filter based on the date and 8 days back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;where a.action_dt &amp;gt; (date - INTERVAL &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'8'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; DAY)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I am looking to change this that the action_dt will always be between Monday and Sunday of the previous week no matter when I run the report that week.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Desired Result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;where a.action_dt between &amp;amp;monday and &amp;amp;sunday&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I am just not sure how to get those variables to always be the previous dates I need based on whatever day I run the report.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2015 17:31:50 GMT</pubDate>
    <dc:creator>Sotarkadin</dc:creator>
    <dc:date>2015-05-26T17:31:50Z</dc:date>
    <item>
      <title>Determing dates of previous Monday and Sunday</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193229#M48515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I have a report I run where I filter based on the date and 8 days back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;where a.action_dt &amp;gt; (date - INTERVAL &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'8'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; DAY)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I am looking to change this that the action_dt will always be between Monday and Sunday of the previous week no matter when I run the report that week.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Desired Result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: Courier New;"&gt;where a.action_dt between &amp;amp;monday and &amp;amp;sunday&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I am just not sure how to get those variables to always be the previous dates I need based on whatever day I run the report.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 17:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193229#M48515</guid>
      <dc:creator>Sotarkadin</dc:creator>
      <dc:date>2015-05-26T17:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Determing dates of previous Monday and Sunday</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193230#M48516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need a shifted time interval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 10pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;_null_&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ref=today();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; monday = intnx(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'week1.2'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,ref,-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'Begin'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sunday = intnx(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'week1.2'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,ref,-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'End'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; _all_ &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;weekdate.&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;_all_&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;)(=/);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;ref=Tuesday, May &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;26&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;2015&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;monday=Monday, May &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;18&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;2015&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;sunday=Sunday, May &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;24&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;2015&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 17:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193230#M48516</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-05-26T17:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Determing dates of previous Monday and Sunday</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193231#M48517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much that relly helped. I do have another question on this same report I am working on.&amp;nbsp; It's a little different but still revolves around day of week.&amp;nbsp; I am not sure if I shoudl start another discussion or can it just be answered here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently joining two tables based on the data an action occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table ltr_chck as&lt;/P&gt;&lt;P&gt;select a.cm15, a.case_nbr, a.action_dt, a.frd_action, a.user_id_cd, b.action_Dt as ltr_action, b.frd_action as ltr_action&lt;/P&gt;&lt;P&gt;from value_actions_dedup a&lt;/P&gt;&lt;P&gt;left join letter_actions_dedup b&lt;/P&gt;&lt;P&gt;on a.action_dt = b.action_dt&lt;/P&gt;&lt;P&gt;where a.cm15 = b.cm15&lt;/P&gt;&lt;P&gt;and a.user_id_cd NE 'XXXXX';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking to specify the join for different date criteria.&amp;nbsp;&amp;nbsp; If the a.action_dt is a Friday, Saturday or Sunday, then it needs to look for the b.action_dt of the Monday after.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on a.action_dt = b.action_dt&lt;/P&gt;&lt;P&gt;or if a.ction_dt is Fri, Sat, Sun then b.action_dt = Mon after&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 18:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193231#M48517</guid>
      <dc:creator>Sotarkadin</dc:creator>
      <dc:date>2015-05-26T18:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Determing dates of previous Monday and Sunday</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193232#M48518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have another question start another thread.&amp;nbsp; Include some sample data that is representative of the join you want to do.&amp;nbsp; Show have and want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 18:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Determing-dates-of-previous-Monday-and-Sunday/m-p/193232#M48518</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-05-26T18:43:27Z</dc:date>
    </item>
  </channel>
</rss>

