<?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: Please help me on how to remove multiple and conditions if condition is failed in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671543#M201676</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/338815"&gt;@Mady8&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simply move all &lt;FONT face="courier new,courier" size="4"&gt;AND&lt;/FONT&gt;s into their preceding %DO-%END block. Thanks to the final, unconditional Boolean expression ("&lt;FONT face="courier new,courier"&gt;COE in&lt;/FONT&gt; ...") you'll always get a valid WHERE statement.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2020 18:59:31 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-07-22T18:59:31Z</dc:date>
    <item>
      <title>Please help me on how to remove multiple and conditions if condition is failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671515#M201668</link>
      <description>&lt;P&gt;&lt;BR /&gt;%let CLIENT_NAME =FUNANCING;&lt;BR /&gt;%LET CLIENT_PL ='Not Selected';&lt;BR /&gt;%let SITE_NAME =Altamonte Springs;&lt;BR /&gt;%LET QUEUE_NAME ='Not Selected';&lt;/P&gt;&lt;P&gt;%macro clientrun;&lt;/P&gt;&lt;P&gt;data Actual_data;&lt;BR /&gt;set change;&lt;BR /&gt;where&lt;BR /&gt;%if &amp;amp;CLIENT_NAME. ^='Not Selected' %then %do;&lt;BR /&gt;CLIENT_NAME in ("&amp;amp;CLIENT_NAME.")&lt;BR /&gt;%end;&lt;BR /&gt;and&lt;BR /&gt;%if &amp;amp;SITE_NAME. ^='Not Selected' %then %do;&lt;BR /&gt;SITE_NAME in ("&amp;amp;SITE_NAME.")&lt;BR /&gt;%end;&lt;BR /&gt;and&lt;BR /&gt;%if &amp;amp;CLIENT_PL.^='Not Selected' %then %do;&lt;BR /&gt;upcase(CLIENT_PL) in ("&amp;amp;CLIENT_PL.")&lt;BR /&gt;%end;&lt;BR /&gt;and&lt;BR /&gt;%if &amp;amp;QUEUE_NAME. ^='Not Selected' %then %do;&lt;BR /&gt;upcase(QUEUE_NAME) in ("&amp;amp;QUEUE_NAME.")&lt;BR /&gt;%end;&lt;BR /&gt;and COE in ("Credit bureau","Dispute and Support")&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;%clientrun;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I ran this code got the below error::&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let CLIENT_NAME =FUNANCING;&lt;BR /&gt;1141 %LET CLIENT_PL ='Not Selected';&lt;BR /&gt;1142 %let SITE_NAME =Altamonte Springs;&lt;BR /&gt;1143 %LET QUEUE_NAME ='Not Selected';&lt;BR /&gt;1144&lt;BR /&gt;1145 %macro clientrun;&lt;BR /&gt;1146&lt;BR /&gt;1147 data Actual_data;&lt;BR /&gt;1148 set change;&lt;BR /&gt;1149 where&lt;BR /&gt;1150 %if &amp;amp;CLIENT_NAME. ^='Not Selected' %then %do;&lt;BR /&gt;1151 CLIENT_NAME in ("&amp;amp;CLIENT_NAME.")&lt;BR /&gt;1152 %end;&lt;BR /&gt;1153 and&lt;BR /&gt;1154 %if &amp;amp;SITE_NAME. ^='Not Selected' %then %do;&lt;BR /&gt;1155 SITE_NAME in ("&amp;amp;SITE_NAME.")&lt;BR /&gt;1156 %end;&lt;BR /&gt;1157 and&lt;BR /&gt;1158 %if &amp;amp;CLIENT_PL.^='Not Selected' %then %do;&lt;BR /&gt;1159 upcase(CLIENT_PL) in ("&amp;amp;CLIENT_PL.")&lt;BR /&gt;1160 %end;&lt;BR /&gt;1161 and&lt;BR /&gt;1162 %if &amp;amp;QUEUE_NAME. ^='Not Selected' %then %do;&lt;BR /&gt;1163 upcase(QUEUE_NAME) in ("&amp;amp;QUEUE_NAME.")&lt;BR /&gt;1164 %end;&lt;BR /&gt;1165 and COE in ("Credit bureau","Dispute and Support")&lt;BR /&gt;1166 ;&lt;BR /&gt;1167 run;&lt;BR /&gt;1168 %mend;&lt;BR /&gt;1169&lt;BR /&gt;1170 %clientrun;&lt;BR /&gt;MLOGIC(CLIENTRUN): Beginning execution.&lt;BR /&gt;MPRINT(CLIENTRUN): data Actual_data;&lt;BR /&gt;MPRINT(CLIENTRUN): set change;&lt;BR /&gt;SYMBOLGEN: Macro variable CLIENT_NAME resolves to FUNANCING&lt;BR /&gt;MLOGIC(CLIENTRUN): %IF condition &amp;amp;CLIENT_NAME. ^='Not Selected' is TRUE&lt;BR /&gt;SYMBOLGEN: Macro variable CLIENT_NAME resolves to FUNANCING&lt;BR /&gt;SYMBOLGEN: Macro variable SITE_NAME resolves to Altamonte Springs&lt;BR /&gt;MLOGIC(CLIENTRUN): %IF condition &amp;amp;SITE_NAME. ^='Not Selected' is TRUE&lt;BR /&gt;SYMBOLGEN: Macro variable SITE_NAME resolves to Altamonte Springs&lt;BR /&gt;SYMBOLGEN: Macro variable CLIENT_PL resolves to 'Not Selected'&lt;BR /&gt;MLOGIC(CLIENTRUN): %IF condition &amp;amp;CLIENT_PL.^='Not Selected' is FALSE&lt;BR /&gt;SYMBOLGEN: Macro variable QUEUE_NAME resolves to 'Not Selected'&lt;BR /&gt;MLOGIC(CLIENTRUN): %IF condition &amp;amp;QUEUE_NAME. ^='Not Selected' is FALSE&lt;BR /&gt;MPRINT(CLIENTRUN): where CLIENT_NAME in ("FUNANCING") and SITE_NAME in ("Altamonte Springs")&lt;BR /&gt;&lt;STRONG&gt;and and and&lt;/STRONG&gt; COE in ("Credit bureau","Dispute and Support") ;&lt;BR /&gt;ERROR: Variable and is not on file WORK.CHANGE.&lt;BR /&gt;MPRINT(CLIENTRUN): run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.ACTUAL_DATA may be incomplete. When this step was stopped there&lt;BR /&gt;were 0 observations and 284 variables.&lt;BR /&gt;WARNING: Data set WORK.ACTUAL_DATA was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MLOGIC(CLIENTRUN): Ending execution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see if condition is failed AND operator is keeps on adding. How to deal with it please help me&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 18:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671515#M201668</guid>
      <dc:creator>Mady8</dc:creator>
      <dc:date>2020-07-22T18:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me on how to remove multiple and conditions if condition is failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671523#M201671</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CLIENT_NAME =FUNANCING;
%LET CLIENT_PL ='Not Selected';
%let SITE_NAME =Altamonte Springs;
%LET QUEUE_NAME ='Not Selected';

%macro clientrun;

data Actual_data;
set change;
where
%if &amp;amp;CLIENT_NAME. ^='Not Selected' %then %do;
CLIENT_NAME in ("&amp;amp;CLIENT_NAME.")
%end;
%else %do;
1=1
%end;
and
%if &amp;amp;SITE_NAME. ^='Not Selected' %then %do;
SITE_NAME in ("&amp;amp;SITE_NAME.")
%end;
%else %do;
1=1
%end;
and
%if &amp;amp;CLIENT_PL.^='Not Selected' %then %do;
upcase(CLIENT_PL) in ("&amp;amp;CLIENT_PL.")
%end;
%else %do;
1=1
%end;
and
%if &amp;amp;QUEUE_NAME. ^='Not Selected' %then %do;
upcase(QUEUE_NAME) in ("&amp;amp;QUEUE_NAME.")
%end;
%else %do;
1=1
%end;
and COE in ("Credit bureau","Dispute and Support")
;
run;
%mend;

%clientrun;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 18:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671523#M201671</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-07-22T18:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me on how to remove multiple and conditions if condition is failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671543#M201676</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/338815"&gt;@Mady8&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simply move all &lt;FONT face="courier new,courier" size="4"&gt;AND&lt;/FONT&gt;s into their preceding %DO-%END block. Thanks to the final, unconditional Boolean expression ("&lt;FONT face="courier new,courier"&gt;COE in&lt;/FONT&gt; ...") you'll always get a valid WHERE statement.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 18:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671543#M201676</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-07-22T18:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me on how to remove multiple and conditions if condition is failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671665#M201726</link>
      <description>&lt;P&gt;Another version&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CLIENT_NAME =FUNANCING;
%LET CLIENT_PL ='Not Selected';
%let SITE_NAME =Altamonte Springs;
%LET QUEUE_NAME ='Not Selected';
%macro clientrun;
data Actual_data;
set change;
where
%if &amp;amp;CLIENT_NAME. ^='Not Selected' %then %do;
CLIENT_NAME in ("&amp;amp;CLIENT_NAME.") and
%end;
%if &amp;amp;SITE_NAME. ^='Not Selected' %then %do;
SITE_NAME in ("&amp;amp;SITE_NAME.") and
%end;
%if &amp;amp;CLIENT_PL.^='Not Selected' %then %do;
upcase(CLIENT_PL) in ("&amp;amp;CLIENT_PL.") and
%end;
%if &amp;amp;QUEUE_NAME. ^='Not Selected' %then %do;
upcase(QUEUE_NAME) in ("&amp;amp;QUEUE_NAME.") and
%end;
COE in ("Credit bureau","Dispute and Support")
;
run;
%mend;
%clientrun;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jul 2020 04:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-me-on-how-to-remove-multiple-and-conditions-if/m-p/671665#M201726</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-07-23T04:52:54Z</dc:date>
    </item>
  </channel>
</rss>

