<?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: create macro to go back from start date in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165369#M12734</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dates are just numbers, so the easy thing to do is to ensure you seed your %EVAL expression with them as numbers using SAS functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;/* 10 days before today */&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; cutoff = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(today()) - 10);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;/* 10 days before April 1, 2014 */&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; cutoff = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(mdy(4,1,2014)) - 10);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;Chris&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jul 2014 14:46:52 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2014-07-03T14:46:52Z</dc:date>
    <item>
      <title>create macro to go back from start date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165368#M12733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to bring data 10 days older from the start date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a macro for start date shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let start_dt = '01APR2014'd ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;% let old_dt = %eval(%input(&amp;amp;start_dt ,8.)&amp;nbsp; -&amp;nbsp; 10);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this gives erro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 14:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165368#M12733</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2014-07-03T14:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: create macro to go back from start date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165369#M12734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dates are just numbers, so the easy thing to do is to ensure you seed your %EVAL expression with them as numbers using SAS functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;/* 10 days before today */&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; cutoff = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(today()) - 10);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;/* 10 days before April 1, 2014 */&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; cutoff = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(mdy(4,1,2014)) - 10);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;Chris&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 14:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165369#M12734</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2014-07-03T14:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: create macro to go back from start date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165370#M12735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; %LET old_dt=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%Sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(PutN(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%Sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;(IntNX(day,&amp;amp;start_dt.,-10)),Date9.));&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 14:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165370#M12735</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-07-03T14:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: create macro to go back from start date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165371#M12736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, few things there.&amp;nbsp; The start_dt macro variable will contain the text '01APR2014'd&lt;/P&gt;&lt;P&gt;when this resovles on the eval you will get: %let old_dt = %eval(%input('01APR2014'd ,8.)&amp;nbsp; -&amp;nbsp; 10);&lt;/P&gt;&lt;P&gt;This will fail as there is a d after the quote.&amp;nbsp; Also, you have a space between the % and let.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I would question why you need to do this as:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('OLD_DT','01APR2014'd - 10);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;would give the result, plus several other methods of getting there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 14:54:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165371#M12736</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-03T14:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: create macro to go back from start date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165372#M12737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris example seems simple to use. I will try that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks all &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2014 15:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-macro-to-go-back-from-start-date/m-p/165372#M12737</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2014-07-03T15:04:10Z</dc:date>
    </item>
  </channel>
</rss>

