<?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 Date generation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631345#M187055</link>
    <description>&lt;P&gt;Apologies for the rather simplistic question. But I have a date set I generate in the code to reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;REPORTDATE = intnx('Week',today(),-1,'E');&lt;/P&gt;
&lt;P&gt;CW_END &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = intnx('Week',ReportDate,&lt;STRONG&gt;0&lt;/STRONG&gt;,'E');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives me the most recent Saturday that passed for a report I generate. I need to be able to get this exact Date in the previous year. So in this case March 7 2020 is the date generated from above code. I need to get March 7 2019. I would use a hard coded calculation but that would mess up in Leap years like this year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 11 Mar 2020 18:54:54 GMT</pubDate>
    <dc:creator>Jyuen204</dc:creator>
    <dc:date>2020-03-11T18:54:54Z</dc:date>
    <item>
      <title>Date generation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631345#M187055</link>
      <description>&lt;P&gt;Apologies for the rather simplistic question. But I have a date set I generate in the code to reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;REPORTDATE = intnx('Week',today(),-1,'E');&lt;/P&gt;
&lt;P&gt;CW_END &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = intnx('Week',ReportDate,&lt;STRONG&gt;0&lt;/STRONG&gt;,'E');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives me the most recent Saturday that passed for a report I generate. I need to be able to get this exact Date in the previous year. So in this case March 7 2020 is the date generated from above code. I need to get March 7 2019. I would use a hard coded calculation but that would mess up in Leap years like this year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 18:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631345#M187055</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2020-03-11T18:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date generation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631346#M187056</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;oneyearago=intnx('year',cw_end,-1,'s');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Mar 2020 18:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631346#M187056</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-11T18:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Date generation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631351#M187061</link>
      <description>The last parameter in the INTNX function is the alignment parameter. The option you're looking for is 'same' which will move it to the same date. Verify it treats leap years the way you want and you're good to go. You can also extract the month day and increment the year and use MDY() BUT that won't work for leap years so INTNX() is safer.</description>
      <pubDate>Wed, 11 Mar 2020 19:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631351#M187061</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-11T19:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date generation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631360#M187068</link>
      <description>&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 19:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-generation/m-p/631360#M187068</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2020-03-11T19:42:11Z</dc:date>
    </item>
  </channel>
</rss>

