<?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 Need to compare two sas MACRO VARIABLE containing string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314293#M270814</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to compare two macro variables containig string in macro program but it doesn't work.&lt;/P&gt;&lt;P&gt;Please see my code :&lt;/P&gt;&lt;P&gt;%if &amp;amp;currentdateFile = &amp;amp;LastDateFileToImport %then %do;&lt;/P&gt;&lt;P&gt;It seems that this condition is always true.&lt;/P&gt;&lt;P&gt;Where is my mistake?&lt;/P&gt;&lt;P&gt;Thanks a lot for your help&lt;/P&gt;</description>
    <pubDate>Fri, 25 Nov 2016 12:46:04 GMT</pubDate>
    <dc:creator>PSIOT</dc:creator>
    <dc:date>2016-11-25T12:46:04Z</dc:date>
    <item>
      <title>Need to compare two sas MACRO VARIABLE containing string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314293#M270814</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to compare two macro variables containig string in macro program but it doesn't work.&lt;/P&gt;&lt;P&gt;Please see my code :&lt;/P&gt;&lt;P&gt;%if &amp;amp;currentdateFile = &amp;amp;LastDateFileToImport %then %do;&lt;/P&gt;&lt;P&gt;It seems that this condition is always true.&lt;/P&gt;&lt;P&gt;Where is my mistake?&lt;/P&gt;&lt;P&gt;Thanks a lot for your help&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 12:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314293#M270814</guid>
      <dc:creator>PSIOT</dc:creator>
      <dc:date>2016-11-25T12:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two sas MACRO VARIABLE containing string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314294#M270815</link>
      <description>&lt;P&gt;Do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put currentdateFile="&amp;amp;currentdateFile";
%put LastDateFileToImport="&amp;amp;LastDateFileToImport";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;immediately before your %if and then post the log of this.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 12:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314294#M270815</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-25T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two sas MACRO VARIABLE containing string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314295#M270816</link>
      <description>&lt;P&gt;What do those macro variables resolve to? &amp;nbsp;I can tell nothing from that snippet.&lt;/P&gt;
&lt;P&gt;To test macro variable and such like:&lt;/P&gt;
&lt;P&gt;options mlogic mprint symbolgen;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put that before your program and you will see in the log all the information you need, its likely to be a spaces issue, or casing or something similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To note, you don't need to do the process that way at all. &amp;nbsp;If you show your code, then can advise, but if its text files, you can do in one datastep, and if Excel files or something, a dir list and datastep to generate a proc import for each dir would be simpler:&lt;/P&gt;
&lt;PRE&gt;file mytemp pipe 'dir "c:\some\where\*.xlsx" /b';

data _null_;
  length bf $2000;
  infile mytemp dlm="¬";
  input bf $;
  call execute('proc import datafile="c:\some\where\'||strip(bf)||'" out=mydata'||strip(put(_n_,best.))||'; run;');
run;
  &lt;/PRE&gt;
&lt;P&gt;This does a dir - then generates a proc import for each file in that dir, out is set as mydataX, where X is the row number. &amp;nbsp;You can modify as per your data.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 12:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314295#M270816</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-25T12:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two sas MACRO VARIABLE containing string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314296#M270817</link>
      <description>&lt;P&gt;It also may be that the macro is used in a way that makes it appear as if the condition is always true.&lt;/P&gt;
&lt;P&gt;To determine that, you would need to post the whole macro code and the Base SAS code where it is used.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 12:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314296#M270817</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-25T12:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need to compare two sas MACRO VARIABLE containing string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314302#M270818</link>
      <description>&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;The answer is &amp;nbsp;%if "&amp;amp;currentdateFile" = "&amp;amp;LastDateFileToImport" &amp;nbsp;%then &amp;nbsp;%do;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 13:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-compare-two-sas-MACRO-VARIABLE-containing-string/m-p/314302#M270818</guid>
      <dc:creator>PSIOT</dc:creator>
      <dc:date>2016-11-25T13:57:18Z</dc:date>
    </item>
  </channel>
</rss>

