<?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 Help for date logic to generate week to week report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38031#M7613</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I run many batch jobs for various time periods. Here is a typical data step to create two macro variables for the start and end of the previous week;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data date_parms;&lt;/P&gt;&lt;P&gt;&amp;nbsp; analysis_date=today();&lt;/P&gt;&lt;P&gt;&amp;nbsp; date1=intnx('week',analysis_date,-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; date2=intnx('week',analysis_date,-1,'end);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('start_date',date1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('end_date',date2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; format analysis_date, date1 date2 date7.;)&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;start_date and &amp;amp;end_date are macro variables for the start and end of the previous week. If you need to rerun the program for a prior week you just need to change the analysis_date to a prior week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Oct 2011 09:12:26 GMT</pubDate>
    <dc:creator>barheat</dc:creator>
    <dc:date>2011-10-31T09:12:26Z</dc:date>
    <item>
      <title>Help for date logic to generate week to week report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38028#M7610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;Here i want to generate report from date 15thoct to 22oct. i am wondering what logic should be for second data&amp;nbsp; _null_ statement to generate data for same date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;Infirst data _null_ statement, i have changed date to '22oct11'd for same date 1 and date2. i am not sure about what date logic for second data _null_statement. &lt;/P&gt;&lt;P style="text-align: left;"&gt;Please guide....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 00:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38028#M7610</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2011-10-31T00:20:33Z</dc:date>
    </item>
    <item>
      <title>Help for date logic to generate week to week report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38029#M7611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain more what you want to happen.&amp;nbsp; I looks to me that you are creating DATE1 and DATE2 macro variables in the first data step and then just referencing them in the second.&amp;nbsp; What else do you want to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 01:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38029#M7611</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-31T01:15:12Z</dc:date>
    </item>
    <item>
      <title>Help for date logic to generate week to week report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38030#M7612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; OK. sir. this is my weekly bundle process but it was failed to run last week so i just want to pullup data for date 15th oct -22nd oct, so if i change &lt;STRONG&gt;date( )&lt;/STRONG&gt; to &lt;STRONG&gt;'22oct11' d &lt;/STRONG&gt;for both date1 and date2, dataset will pullup data for same date that i want but i am not sure what date logic should be for second data _null_ statement. Is there anything need to be change in that or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sandip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 01:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38030#M7612</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2011-10-31T01:43:15Z</dc:date>
    </item>
    <item>
      <title>Help for date logic to generate week to week report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38031#M7613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I run many batch jobs for various time periods. Here is a typical data step to create two macro variables for the start and end of the previous week;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data date_parms;&lt;/P&gt;&lt;P&gt;&amp;nbsp; analysis_date=today();&lt;/P&gt;&lt;P&gt;&amp;nbsp; date1=intnx('week',analysis_date,-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; date2=intnx('week',analysis_date,-1,'end);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('start_date',date1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('end_date',date2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; format analysis_date, date1 date2 date7.;)&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;start_date and &amp;amp;end_date are macro variables for the start and end of the previous week. If you need to rerun the program for a prior week you just need to change the analysis_date to a prior week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 09:12:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-date-logic-to-generate-week-to-week-report/m-p/38031#M7613</guid>
      <dc:creator>barheat</dc:creator>
      <dc:date>2011-10-31T09:12:26Z</dc:date>
    </item>
  </channel>
</rss>

