<?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: today () - 14) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601907#M174180</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
_2_wks_ago=intnx('week',today(),-2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Nov 2019 08:51:46 GMT</pubDate>
    <dc:creator>sustagens</dc:creator>
    <dc:date>2019-11-06T08:51:46Z</dc:date>
    <item>
      <title>today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601906#M174179</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to subtract the date of the day 2 weeks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;% let day =% sysfunc (today () - 14);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 08:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601906#M174179</guid>
      <dc:creator>WilliamB</dc:creator>
      <dc:date>2019-11-06T08:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601907#M174180</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
_2_wks_ago=intnx('week',today(),-2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 08:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601907#M174180</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2019-11-06T08:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601909#M174182</link>
      <description>&lt;P&gt;As pure macro code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let day=%eval(%sysfunc(today()) - 14);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let day=%sysfunc(intnx(week,%sysfunc(today()),-2,s));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 08:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601909#M174182</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T08:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601911#M174183</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281550"&gt;@sustagens&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
_2_wks_ago=intnx('week',today(),-2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This will not give you the wanted value, run this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
_2_wks_ago=intnx('week',today(),-2);
wanted = today() - 14;
put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You need to add the 's' modifier to the intnx call.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 09:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601911#M174183</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T09:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601913#M174184</link>
      <description>Missed that, I agree. Without the 's' it will subtract two weeks from the date, yes, but it will give the starting day of the week which is the Sunday of that week</description>
      <pubDate>Wed, 06 Nov 2019 09:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601913#M174184</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2019-11-06T09:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601915#M174186</link>
      <description>Thank you very much, how to put it in date9 format.</description>
      <pubDate>Wed, 06 Nov 2019 09:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601915#M174186</guid>
      <dc:creator>WilliamB</dc:creator>
      <dc:date>2019-11-06T09:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601916#M174187</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let day=%sysfunc(intnx(week,%sysfunc(today()),-2,s),date9.);
%put &amp;amp;=day;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 09:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601916#M174187</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2019-11-06T09:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: today () - 14)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601917#M174188</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112281"&gt;@WilliamB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you very much, how to put it in date9 format.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Apply the date9. format in the %sysfunc.&lt;/P&gt;
&lt;P&gt;But what for? For calculations and comparisons, the raw value is much easier to handle. And for display, there are much better formats like e8601da10. (ISO 8601 date format).&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 09:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/today-14/m-p/601917#M174188</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T09:24:58Z</dc:date>
    </item>
  </channel>
</rss>

