<?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: Problem with my macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-my-macro/m-p/481611#M124610</link>
    <description>&lt;P&gt;The fact that the top half runs fine is a lucky accident.&amp;nbsp; Macro language is treating &amp;amp;PROBF as a character string and comparing it to the character string "0.1".&amp;nbsp; To make a numeric comparison, use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %sysevalf(&amp;amp;probf &amp;gt;= 0.1) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the bottom half, macro language does not process multiple comparisons the same way that a DATA step would.&amp;nbsp; You will need to spell them out as two comparisons:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%else %if %sysevalf(0 &amp;lt;= &amp;amp;probf) and %sysevalf(&amp;amp;probf &amp;lt; 0.1) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Technically, since you are using %else, you could eliminate the second comparison:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%else %if %sysevalf(0 &amp;lt;= &amp;amp;probf) %then %do;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jul 2018 17:28:43 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-07-26T17:28:43Z</dc:date>
    <item>
      <title>Problem with my macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-my-macro/m-p/481607#M124608</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I recently wrote a SAS code as below.&lt;/P&gt;&lt;P&gt;The idea is if the &amp;amp;probf is =&amp;gt; 0.1 then run the first model; if the &amp;amp;probf &amp;lt;0.1 then run the second model. This code runs fine however, when my &amp;amp;probf =&amp;nbsp;1.4513221E-6, it seems only run the first model regardless this probf value is actually less than 0.1.&lt;/P&gt;&lt;P&gt;Can you please let me know if you know why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;probf &amp;gt;= 0.1 %then&lt;BR /&gt;%do;&lt;BR /&gt;ods output diffs=lsdiff LSMeans=lsm Tests3=Tests3;&lt;/P&gt;&lt;P&gt;proc mixed data=admmtt method=REML covtest alpha=0.05;&lt;BR /&gt;class usubjid trt01pn atptn siteid;&lt;BR /&gt;model aval= trt01pn atptn siteid trt01pn*atptn/htype=3 ddfm=KENWARDROGER;&lt;BR /&gt;repeated atptn/sub=usubjid type=&amp;amp;type1;&lt;BR /&gt;lsmeans atptn*trt01pn/pdiff cl alpha=0.05;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%else %if 0 =&amp;lt; &amp;amp;probf &amp;lt; 0.1 %then&lt;BR /&gt;%do;&lt;BR /&gt;ods output diffs=lsdiff LSMeans=lsm Tests3=Tests3;&lt;/P&gt;&lt;P&gt;proc mixed data=admmtt method=REML covtest alpha=0.05;&lt;BR /&gt;class usubjid trt01pn atptn siteid;&lt;BR /&gt;model aval= trt01pn atptn siteid trt01pn*atptn trt01pn*siteid/htype=3 ddfm=KENWARDROGER;&lt;BR /&gt;repeated atptn/sub=usubjid type=&amp;amp;type1;&lt;BR /&gt;lsmeans atptn*trt01pn/pdiff cl alpha=0.05;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 17:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-my-macro/m-p/481607#M124608</guid>
      <dc:creator>yahoo0806</dc:creator>
      <dc:date>2018-07-26T17:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-my-macro/m-p/481611#M124610</link>
      <description>&lt;P&gt;The fact that the top half runs fine is a lucky accident.&amp;nbsp; Macro language is treating &amp;amp;PROBF as a character string and comparing it to the character string "0.1".&amp;nbsp; To make a numeric comparison, use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %sysevalf(&amp;amp;probf &amp;gt;= 0.1) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the bottom half, macro language does not process multiple comparisons the same way that a DATA step would.&amp;nbsp; You will need to spell them out as two comparisons:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%else %if %sysevalf(0 &amp;lt;= &amp;amp;probf) and %sysevalf(&amp;amp;probf &amp;lt; 0.1) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Technically, since you are using %else, you could eliminate the second comparison:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%else %if %sysevalf(0 &amp;lt;= &amp;amp;probf) %then %do;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 17:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-my-macro/m-p/481611#M124610</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-26T17:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with my macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-my-macro/m-p/481622#M124612</link>
      <description>&lt;P&gt;It worked! Many thanks! There are still a lot of things I need to explore and learn for SAS macro &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 17:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-my-macro/m-p/481622#M124612</guid>
      <dc:creator>yahoo0806</dc:creator>
      <dc:date>2018-07-26T17:47:39Z</dc:date>
    </item>
  </channel>
</rss>

