<?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: how to resolve 2 macro calls in a WHERE statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794540#M254773</link>
    <description>&lt;P&gt;Your first macro call contains this parameter value:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cedpld= 0&amp;lt;=cedpld&amp;gt;=14&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is probably not the right logic.&amp;nbsp; It means:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(0&amp;lt;=cedpld) and (cedpld &amp;gt;=14)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So at a bare minimum, the first comparison (comparing to zero) is not needed and is included by the second comparison.&amp;nbsp; More likely, though, the logic of the comparisons is not correct.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Feb 2022 15:25:56 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2022-02-04T15:25:56Z</dc:date>
    <item>
      <title>how to resolve 2 macro calls in a WHERE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794450#M254740</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if I'm writing the code correcly, even if I am, the second macro call is not being called and outputting the same results as the first macro.&amp;nbsp; I think the issue might have to do with&amp;nbsp;&lt;CODE class=""&gt;cedpld.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro test(blind=,cedpld =);
proc sort data = adam.adce out = adce ;
by usubjid;
where saffl='Y'&amp;nbsp; &amp;nbsp;and cedplddy=2&amp;nbsp;and&amp;nbsp; &amp;amp;cedpld &amp;nbsp;;
run;

%if &amp;amp;blind=Y %then %do;
  data qc.ds_Blind  ;
    set final;
   run;
%end;

%if &amp;amp;blind=N %then %do;
  data qc.ds_Unblind  ;
    set final;
   run;
%end;
%mend;

%test(blind=Y, cedpld= 0&amp;lt;=cedpld&amp;gt;=14) ;
%test(blind=N, cedpld= 0&amp;lt;=cedpld&amp;lt;14) ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 11:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794450#M254740</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2022-02-04T11:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to resolve 2 macro calls in a WHERE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794454#M254744</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;... the second macro call is not being called and outputting the same results ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We don't know what this means.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;First, run this command to turn on a useful macro debugging tool.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Then run the code again and show us the log for your code (all of it, every single character, do not chop parts out) by copying the log as text and pasting it into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&amp;nbsp;&lt;STRONG&gt;DO NOT SKIP THIS STEP&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66123iA4EF494F9CA0F6EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From now on, when code isn't working, you need to show us the LOG as described above, don't wait for us to ask.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 11:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794454#M254744</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-04T11:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to resolve 2 macro calls in a WHERE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794540#M254773</link>
      <description>&lt;P&gt;Your first macro call contains this parameter value:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cedpld= 0&amp;lt;=cedpld&amp;gt;=14&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is probably not the right logic.&amp;nbsp; It means:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(0&amp;lt;=cedpld) and (cedpld &amp;gt;=14)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So at a bare minimum, the first comparison (comparing to zero) is not needed and is included by the second comparison.&amp;nbsp; More likely, though, the logic of the comparisons is not correct.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 15:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794540#M254773</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-02-04T15:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to resolve 2 macro calls in a WHERE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794544#M254775</link>
      <description>&lt;P&gt;Take the PROC SORT out of the macro and hard code the values.&lt;BR /&gt;Then run it for each case, and check you're getting the results you expect&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = adam.adce out = adce_c1 ;
by usubjid;
where saffl='Y'   and cedplddy=2 and  0&amp;lt;=cedpld&amp;gt;=14 ;
run;

proc sort data = adam.adce out = adce_c2 ;
by usubjid;
where saffl='Y'   and cedplddy=2 and  0&amp;lt;=cedpld&amp;lt;14 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Feb 2022 16:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-resolve-2-macro-calls-in-a-WHERE-statement/m-p/794544#M254775</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-02-04T16:07:58Z</dc:date>
    </item>
  </channel>
</rss>

