<?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: Evaluate multiple dates via Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115271#M23735</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can't specify a = clause if the value that you are trying to compare is a string and you only have a substring in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, you have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If 03OCT2013&amp;nbsp; = ...16MAY2013,13JUN2013,11JUL2013,08AUG2013,05SEP2013,03OCT2013,31OCT2013,28NOV2013)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which it does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHange your code to use a find clause. THerefore&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if find(&amp;amp;varb,&amp;amp;vara) &amp;gt; 1 %then %do;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where varb is your long string and vara is the date you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However i'd change your entire macro code to just use the numeric values of dates (instead of the dates themselves) and then use an in clause instead... that's just me however&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2013 19:18:26 GMT</pubDate>
    <dc:creator>Anotherdream</dc:creator>
    <dc:date>2013-10-17T19:18:26Z</dc:date>
    <item>
      <title>Evaluate multiple dates via Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115269#M23733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;Hello all, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;First time posting, frequent user of the advice found here. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;I have a macro that runs all sorts of different programs based on days of the week and various dates. I'm trying to include another section that runs code based on certain dates. In the first example, the macro condition of &lt;SPAN style="color: #000000;"&gt;&amp;amp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background: none repeat scroll 0% 0% white; font-size: 10pt; font-family: 'Courier New';"&gt;rptdte = &amp;amp;J1&lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; is true and the code runs. However, in the second example, when I try to include other dates as part of &amp;amp;J1 it evaluates too false. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;What is the correct method for evaluating multiple dates in this instance? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;I appreciate your thoughts. Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: blue; font-size: 10pt; background: white; font-family: 'Courier New'; text-decoration: underline; font-weight: bold;"&gt;EXAMPLE 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; A1=100313;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; J1=3OCT2013;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; rptdte=&lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;(inputn(&amp;amp;A1, mmddyy6.), date9.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; &amp;amp;rptdte;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;options&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; mprint mlogic;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; C3_Reports();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; X = &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;(weekday(&lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;(inputn(&amp;amp;a1, mmddyy6.))));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: green; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;/* Code part 3&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;rptdte = &amp;amp;J1 &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%include&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: purple; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;'\\W_gap_fs\Data\Grp\Code part 3.sas'&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%&lt;STRONG&gt;&lt;EM style="font-style: italic; font-weight: bold;"&gt;C3_Reports&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: blue; font-size: 10pt; background: white; font-family: 'Courier New'; text-decoration: underline; font-weight: bold;"&gt;EXAMPLE 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; A1=100313;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; J1 = (27DEC2012,24JAN2013,21FEB2013,21MAR2013,18APR2013,16MAY2013,13JUN2013,11JUL2013,08AUG2013,05SEP2013,03OCT2013,31OCT2013,28NOV2013);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; rptdte=&lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;(inputn(&amp;amp;A1, mmddyy6.), date9.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; &amp;amp;rptdte;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;options&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; mprint mlogic;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; C3_Reports();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; X = &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;(weekday(&lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;(inputn(&amp;amp;a1, mmddyy6.))));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: green; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;/* Code part 3&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt; &amp;amp;rptdte = &amp;amp;J1 &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%include&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: purple; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;'\\W_gap_fs\Data\Grp&lt;/SPAN&gt;&lt;SPAN style="color: purple; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;Code part 3&lt;/SPAN&gt;&lt;SPAN style="color: purple; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;.sas'&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background: white; font-family: 'Courier New'; font-weight: bold;"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;%&lt;STRONG&gt;&lt;EM style="font-style: italic; font-weight: bold;"&gt;C3_Reports&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 19:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115269#M23733</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2013-10-17T19:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate multiple dates via Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115270#M23734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking for IN instead of = perhaps? If so also look up the minoperator when using the in operator in a macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 19:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115270#M23734</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-10-17T19:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate multiple dates via Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115271#M23735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can't specify a = clause if the value that you are trying to compare is a string and you only have a substring in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, you have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If 03OCT2013&amp;nbsp; = ...16MAY2013,13JUN2013,11JUL2013,08AUG2013,05SEP2013,03OCT2013,31OCT2013,28NOV2013)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which it does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHange your code to use a find clause. THerefore&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if find(&amp;amp;varb,&amp;amp;vara) &amp;gt; 1 %then %do;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where varb is your long string and vara is the date you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However i'd change your entire macro code to just use the numeric values of dates (instead of the dates themselves) and then use an in clause instead... that's just me however&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 19:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115271#M23735</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-10-17T19:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate multiple dates via Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115272#M23736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree, using actual SAS dates is better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One reason, that can be a pain to debug is a case mismatch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example in your current syntax 01Jan2013 is NOT EQUAL to 01JAN2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 19:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115272#M23736</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-10-17T19:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate multiple dates via Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115273#M23737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would love to evaluate SAS dates instead of strings but there are other parts to this macro that require me to use strings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution seems obvious now. I changed it too evaluate the following:&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;&lt;SPAN class="836191519-17102013"&gt;%if %sysfunc(find(&amp;amp;j1, &amp;amp;rptdte))&amp;gt;0 %then %do;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;&lt;SPAN class="836191519-17102013"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for the extra set of eyes&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;&lt;SPAN class="836191519-17102013"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 12:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115273#M23737</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2013-10-18T12:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate multiple dates via Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115274#M23738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, just a comment:&lt;/P&gt;&lt;P&gt; You said: "I would love to evaluate SAS dates instead of strings" -- the fundamental nature of the SAS Macro Facility is to work with strings. The Macro Facility is a text-based facility. It exists to resolve macro variable references and generate code for you. By the time your code gets to the compiler, there are NO, nada, zilch &amp;amp;macvar or %macpgm references left in the program. All of the macro "triggers" with &amp;amp; and % have been resolved, and code has been typed. So when you are working with SAS macro variables in a comparison, you are only dealing with text strings. So when you are using %IF, you are comparing strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 13:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115274#M23738</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-10-18T13:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate multiple dates via Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115275#M23739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a great point to remember and one that makes the solution even more obvious too me.Thanks. I'm still fairly new to SAS programming so keeping all of the details straight is tricky. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 13:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-multiple-dates-via-Macro/m-p/115275#M23739</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2013-10-18T13:11:35Z</dc:date>
    </item>
  </channel>
</rss>

