<?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: Setting up date macro by day of week in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74934#M16143</link>
    <description>In general, there's a lot of good info on using SAS dates here:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002200738.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002200738.htm&lt;/A&gt;</description>
    <pubDate>Mon, 13 Dec 2010 15:37:07 GMT</pubDate>
    <dc:creator>PatrickG</dc:creator>
    <dc:date>2010-12-13T15:37:07Z</dc:date>
    <item>
      <title>Setting up date macro by day of week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74931#M16140</link>
      <description>I run a program every weekday that pulls new data from the past 24 hours.  So, I want to go back 1 and 31 days Tues-Thurs and 3 and 33 days on Mon.  How do I set this up?  This is the current code:&lt;BR /&gt;
&lt;BR /&gt;
%LET DATEC = (CURRENT DATE - 31 DAYS);   &lt;BR /&gt;
%LET STARTQT = (CURRENT DATE - 1 DAYS); &lt;BR /&gt;
&lt;BR /&gt;
When I have run the program the past two Mondays, I have manually changed the 31 and 1 to 33 and 3.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help!</description>
      <pubDate>Mon, 27 Sep 2010 13:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74931#M16140</guid>
      <dc:creator>kmcp</dc:creator>
      <dc:date>2010-09-27T13:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up date macro by day of week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74932#M16141</link>
      <description>Look at using the INTNX function in your code.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
intnx function site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
using sas dates intnx site:sas.com</description>
      <pubDate>Mon, 27 Sep 2010 14:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74932#M16141</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-27T14:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up date macro by day of week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74933#M16142</link>
      <description>In addition to the intnx function, you could also use the weekday function.  For example:&lt;BR /&gt;
&lt;BR /&gt;
%let weekday=%sysfunc(weekday(%sysfunc(today())));&lt;BR /&gt;
&lt;BR /&gt;
If you create the macro variable weekday as above, it will have a value of 2 every Monday.  Conditional logic could then be used to determine which date variables to use.</description>
      <pubDate>Mon, 27 Sep 2010 14:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74933#M16142</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2010-09-27T14:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up date macro by day of week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74934#M16143</link>
      <description>In general, there's a lot of good info on using SAS dates here:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002200738.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002200738.htm&lt;/A&gt;</description>
      <pubDate>Mon, 13 Dec 2010 15:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-date-macro-by-day-of-week/m-p/74934#M16143</guid>
      <dc:creator>PatrickG</dc:creator>
      <dc:date>2010-12-13T15:37:07Z</dc:date>
    </item>
  </channel>
</rss>

