<?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: Macro to hold 1 week back date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360511#M84892</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;why bother using a put statement to convert the number (date) into a character form regardless of how it is formatted?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For use in a TITLE statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For use in a LABEL statement?&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2017 18:46:34 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-05-22T18:46:34Z</dc:date>
    <item>
      <title>Macro to hold 1 week back date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360505#M84888</link>
      <description>&lt;P&gt;Can someone help me with a macro that holds one week back date whenever ran?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;call symput('yesterday', put(today()-8, mmddyy10.));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;amp;yesterday;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code. Any better way using intnx or something else?&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 18:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360505#M84888</guid>
      <dc:creator>adityaa9z</dc:creator>
      <dc:date>2017-05-22T18:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to hold 1 week back date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360506#M84889</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/129089"&gt;@adityaa9z&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Can someone help me with a macro that holds one week back date whenever ran?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;call symput('yesterday', put(today()-8, mmddyy10.));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;amp;yesterday;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my code. Any better way using intnx or something else?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your code looks fine, intnx should give the same result so there's really no reason to prefer one over the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your last line should say&lt;/P&gt;
&lt;PRE&gt;%put &amp;amp;yesterday;&lt;/PRE&gt;
&lt;P&gt;I would ask the question about why you want format mmddyy10.&amp;nbsp; if you are going to use &amp;amp;yesterday in labels or titles, then that's a good format to use; if you are going to use this number in calculations, then you don't want a format. Also, it's not clear to me why you want -8 instead of -7, but that's entirely up to you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 18:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360506#M84889</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-05-22T18:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to hold 1 week back date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360509#M84890</link>
      <description>&lt;P&gt;I'll go a step further than&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;: why bother using a put statement to convert the number (date) into a character form regardless of how it is formatted? Also, you don't even need a datastep. e.g.:&lt;/P&gt;
&lt;PRE&gt;%let yesterday=%eval(%sysfunc(today())-8);

%put &amp;amp;yesterday;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2017 18:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360509#M84890</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-22T18:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to hold 1 week back date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360511#M84892</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;why bother using a put statement to convert the number (date) into a character form regardless of how it is formatted?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For use in a TITLE statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For use in a LABEL statement?&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 18:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360511#M84892</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-05-22T18:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to hold 1 week back date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360513#M84893</link>
      <description>&lt;P&gt;Agreed .. IF that is how it is going to be used! However, NOT if it is only going to be used as a SAS date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, back to what I think&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/129089"&gt;@adityaa9z&lt;/a&gt;&amp;nbsp;was asking, there is NO better way to calculate eight days before a date than doing what you did: a simple subtraction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 18:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360513#M84893</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-22T18:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to hold 1 week back date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360514#M84894</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Agreed .. IF that is how it is going to be used! However, NOT if it is only going to be used as a SAS date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So we're in agreement, and we're both saying the same thing!&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 18:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-to-hold-1-week-back-date/m-p/360514#M84894</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-05-22T18:55:22Z</dc:date>
    </item>
  </channel>
</rss>

