<?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: %IF Statement and Macro resolution in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IF-Statement-and-Macro-resolution/m-p/232240#M308396</link>
    <description>Change the %IF %THEN %DO %END to IF THEN DO END</description>
    <pubDate>Thu, 29 Oct 2015 15:49:49 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2015-10-29T15:49:49Z</dc:date>
    <item>
      <title>%IF Statement and Macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-Statement-and-Macro-resolution/m-p/232236#M308395</link>
      <description>&lt;P&gt;Hey. So I'm trying to execute a macro subroutine using the conditional statements %IF-%THEN. The following is the code I'm trying to run:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS MPRINT MLOGIC;
%macro new_seg(cod,seg,bus_seg);
 data client;
  set client;
   %if cod_seg2="&amp;amp;cod" %then %do;
     new_seg="&amp;amp;seg";
     new_bus_seg="&amp;amp;bus_seg";
    %end;
 run;
%mend new_seg;

%new_seg(RE,REAL ESTATE,REAL ESTATE);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Everytime I try to execute the code, it gets stuck at the %IF statement and says the following: "MLOGIC(NEW_SEG): %IF condition cod_seg2="&amp;amp;cod" is FALSE". I'm not sure why it says it's false since the variable cod_seg2 in my dataset does have 'RE' as a value. Is SAS not resolving to the correct value of the parameter or am I not explicitly coding the conditional statement correctly?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-Statement-and-Macro-resolution/m-p/232236#M308395</guid>
      <dc:creator>mc</dc:creator>
      <dc:date>2015-10-29T15:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: %IF Statement and Macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-Statement-and-Macro-resolution/m-p/232240#M308396</link>
      <description>Change the %IF %THEN %DO %END to IF THEN DO END</description>
      <pubDate>Thu, 29 Oct 2015 15:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-Statement-and-Macro-resolution/m-p/232240#M308396</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-10-29T15:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: %IF Statement and Macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-Statement-and-Macro-resolution/m-p/232244#M308397</link>
      <description>That did the trick. Thanks for your help!</description>
      <pubDate>Thu, 29 Oct 2015 15:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-Statement-and-Macro-resolution/m-p/232244#M308397</guid>
      <dc:creator>mc</dc:creator>
      <dc:date>2015-10-29T15:54:37Z</dc:date>
    </item>
  </channel>
</rss>

