<?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: Comparing Macro Variable date to date literal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434642#M107878</link>
    <description>&lt;P&gt;If you're going down the conversion route, then yes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112183"&gt;@mhodge20&lt;/a&gt; wrote:&lt;BR /&gt;I would need a %sysfunc and inputn?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2018 18:41:33 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-06T18:41:33Z</dc:date>
    <item>
      <title>Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434636#M107874</link>
      <description>&lt;P&gt;%let x = 01/01/2018;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro loop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;x. ge&amp;nbsp;'01Jan2017'd %then leave;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I accurately compare the date that is the macro variable and the date literal?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434636#M107874</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T18:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434638#M107875</link>
      <description>&lt;P&gt;1. Either define the macro variable as a data literal like you did in the code&lt;/P&gt;
&lt;P&gt;2. Use INPUT to convert the macro variable to a &amp;nbsp;date literal to allow the comparison.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112183"&gt;@mhodge20&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;%let x = 01/01/2018;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro loop;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;x. ge&amp;nbsp;'01Jan2017'd %then leave;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I accurately compare the date that is the macro variable and the date literal?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434638#M107875</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-06T18:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434639#M107876</link>
      <description>I would need a %sysfunc and inputn?</description>
      <pubDate>Tue, 06 Feb 2018 18:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434639#M107876</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T18:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434641#M107877</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112183"&gt;@mhodge20&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;%let x = 01/01/2018;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro loop;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;x. ge&amp;nbsp;'01Jan2017'd %then leave;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I accurately compare the date that is the macro variable and the date literal?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x = '01JAN2018'd;
%macro loop;
%if &amp;amp;x. ge '01Jan2017'd %then leave;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434641#M107877</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-02-06T18:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434642#M107878</link>
      <description>&lt;P&gt;If you're going down the conversion route, then yes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112183"&gt;@mhodge20&lt;/a&gt; wrote:&lt;BR /&gt;I would need a %sysfunc and inputn?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434642#M107878</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-06T18:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434643#M107879</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;use sysevalf:

%let x = '01JAN2018'd;
%macro loop;
%if %sysevalf(&amp;amp;x. ge '01Jan2017'd) %then %put leave;
%mend;

%loop&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434643#M107879</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-06T18:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434644#M107880</link>
      <description>&lt;P&gt;You do have more work ahead of you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In macro language, 01/01/2018 means 1, divided by 1, divided by 2018.&amp;nbsp; That's why you need the conversion.&amp;nbsp; (Yes, you are mentioning the correct tools.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, macro language will not interpret date literals as is.&amp;nbsp; You will need to wrap the date literal with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%sysevalf('01Jan2017'd)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, I don't think LEAVE is&amp;nbsp;a macro language statement.&amp;nbsp; I could be wrong here.&amp;nbsp; But I believe that %LOOP is saying to make the comparison, and if the comparison is true add the word LEAVE to your SAS program.&amp;nbsp;&amp;nbsp;To correct that, you would have to show more of what is inside the definition of %LOOP.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434644#M107880</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-06T18:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434645#M107881</link>
      <description>the %let is actually a loop im spitting out not me writing a date literal.&lt;BR /&gt;&lt;BR /&gt;%do II = 1 %to 12&lt;BR /&gt;%let x = %sysfunc(intnx(month,&amp;amp;termdate.,&amp;amp;ii,B),Date9.);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%if &amp;amp;x. ge '01FEB2018'd %then leave;&lt;BR /&gt;%else;</description>
      <pubDate>Tue, 06 Feb 2018 18:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434645#M107881</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T18:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434646#M107882</link>
      <description>If the comparison is true then leave the loop.</description>
      <pubDate>Tue, 06 Feb 2018 18:49:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434646#M107882</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T18:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434650#M107883</link>
      <description>&lt;P&gt;You probably need a %LEAVE&lt;/P&gt;
&lt;P&gt;And if you're using INTNX it will automatically return a SAS date so you don't need to worry about the format/appearance.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434650#M107883</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-06T18:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434651#M107884</link>
      <description>I thought the macrovariable would be saved as a character string and I would have to convert the string to date in order to compare it with a date literal?</description>
      <pubDate>Tue, 06 Feb 2018 18:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434651#M107884</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T18:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434653#M107885</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;There is no %leave like leave in datastep.&amp;nbsp; I wonder why the OP is so much into macro in the first place. In most cases, perhaps there is no need for maco.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway to exit the loop, if the OP is using a iterative %do loop. Once the %if condition is satisfied, OP has to&lt;EM&gt;&lt;STRONG&gt; reset&lt;/STRONG&gt;&lt;/EM&gt; the the do index variable to stop value or use %do %until(conditon=true) . My 2 cents&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 18:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434653#M107885</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-02-06T18:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434659#M107887</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;You're correct.&lt;/P&gt;
&lt;P&gt;You can also use a standard %IF/%THEN/%ELSE to control the loop, but we'd need more of the code or the requirements to understand what the best approach is. &amp;nbsp;For the OP, there's an example of looping with dates in the SAS macro appendix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n01vuhy8h909xgn16p0x6rddpoj9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n01vuhy8h909xgn16p0x6rddpoj9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 19:01:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434659#M107887</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-06T19:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434661#M107889</link>
      <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt; &lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;P&gt;I had the loop spit out a Date9. and then wrapped it in %str(%') to produce a date literal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let x = %sysfunc(intnx(month,&amp;amp;termdate.,&amp;amp;ii,B),Date9.);&lt;BR /&gt;%let t = %str(%')&amp;amp;x.%str(%')d;&lt;/P&gt;&lt;P&gt;%put &amp;amp;t.&amp;nbsp;&lt;/P&gt;&lt;P&gt;'01FEB2015'd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;t. ge '01FEB2018'd %then leave;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 19:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434661#M107889</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T19:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434667#M107892</link>
      <description>&lt;P&gt;Spoiler:&amp;nbsp; You are still a long way from having useful code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The word LEAVE is still not going to be useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The comparison is still incorrect even if there are no syntax errors.&amp;nbsp; (Try using '01SEP2015'd vs. '01FEB2018'd for example.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rather than fix those issues, you would be better advised to show how %LOOP is supposed to be used.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 19:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434667#M107892</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-06T19:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434671#M107894</link>
      <description>&lt;P&gt;I didnt&amp;nbsp;mean to put the spolier&amp;nbsp;lines there. grey bars showed up and I didnt&amp;nbsp;know what they were or how to remove them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is what im&amp;nbsp;trying to Accomplish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of datasets that are sequentially names with year and month. Ex. Perf_200504 - Perf_201801&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of dates in another table by client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to stack client relevant data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if client 1234 date is 01/01/2016, stack all client information from each dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to loop through each dataset from the point of a specific date and stack all later datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this makes sense&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 19:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434671#M107894</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T19:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434677#M107899</link>
      <description>&lt;P&gt;OK, some key information then:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What is the LIBNAME for the folder holding the data?&lt;/LI&gt;
&lt;LI&gt;What is the LIBNAME for the separate table holding the list of clients?&lt;/LI&gt;
&lt;LI&gt;In that list of clients, how is that date field stored?&amp;nbsp; As a character string?&amp;nbsp; As a SAS date?&amp;nbsp; What is the actual value, and what is the formatted value (if that's different than the actual value)?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Can I assume from your example (where the date is 01/01/2016) that you want to extract everything from Perf_201601, everything from Perf_201602, all the way through everything from Perf_201801?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 19:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434677#M107899</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-06T19:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434678#M107900</link>
      <description>libname for perf data is perf&lt;BR /&gt;list of clients and dates are in work, in dataset called clients&lt;BR /&gt;&lt;BR /&gt;The date is a sas date formatted as MMDDYY10.&lt;BR /&gt;&lt;BR /&gt;and the assumption at the bottom is correct&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Feb 2018 19:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434678#M107900</guid>
      <dc:creator>mhodge20</dc:creator>
      <dc:date>2018-02-06T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Macro Variable date to date literal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434700#M107909</link>
      <description>&lt;P&gt;One way to go:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro one_client (client=);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; %local starting_ym dataset_list;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; data start;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set clients;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where client = &amp;amp;client;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx('starting_ym', catt(year(date), month(date));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct 'perf.' || memname into : dataset_list separated by ' '&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.tables&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where substr(upcase(memname), 1, 5)) = 'PERF_' and substr(memname, 6, 6) &amp;gt;= "&amp;amp;starting_ym"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &amp;amp;dataset_list;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend one_client;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, it's untested code.&amp;nbsp; Minor tweaks might be needed.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 21:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Macro-Variable-date-to-date-literal/m-p/434700#M107909</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-06T21:26:50Z</dc:date>
    </item>
  </channel>
</rss>

