<?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: Evaluating Math Expressions with Macros in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137516#M11075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use a function such as MIN generally then you want %sysfunc for macro calculations.&lt;/P&gt;&lt;P&gt;It looks like your are attempting to use data set variable names in the MIN is that the case? If so then you probably shouldn't be using %if as the macro comparison won't have the values of the dataset variables. The macro is resolved at compile not datastep execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend posting the enough code to see how you are using this %IF. If inside a data step then the entire data step may be needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Jul 2014 15:21:34 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-07-25T15:21:34Z</dc:date>
    <item>
      <title>Evaluating Math Expressions with Macros</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137515#M11074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand that macro variables are text values, so it has a hard time with things like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%if &amp;amp;var. &amp;lt; 5 %then %do&lt;/STRONG&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when &amp;amp;var. = 1.3 (since the decimal is considered a character and therefore not evaluable).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a line of code that I cannot get past because of this issue.&amp;nbsp; Here is what I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%if compute&amp;amp;j. = min(of compute1-compute&amp;amp;maxvisit.) %then %do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have even tried putting the expression in a %sysevalf() function to see if that would help--no go:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%if %sysevalf(compute&amp;amp;j. = min(of compute1-compute&amp;amp;maxvisit.)) %then %do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how I can work around this?&amp;nbsp; If you need more code from me, let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 14:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137515#M11074</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2014-07-25T14:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating Math Expressions with Macros</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137516#M11075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use a function such as MIN generally then you want %sysfunc for macro calculations.&lt;/P&gt;&lt;P&gt;It looks like your are attempting to use data set variable names in the MIN is that the case? If so then you probably shouldn't be using %if as the macro comparison won't have the values of the dataset variables. The macro is resolved at compile not datastep execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend posting the enough code to see how you are using this %IF. If inside a data step then the entire data step may be needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 15:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137516#M11075</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-07-25T15:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating Math Expressions with Macros</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137517#M11076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing this in PROC REPORT.&amp;nbsp; I wanted to use the CALL DEFINE statement to highlight cells if the cell was the minimum value of the other cells in that row.&amp;nbsp; You did give me an idea that helped.&amp;nbsp; In the data step that creates the input data for PROC REPORT, I just defined a new variable called MINCOMPUTE, then I was able to change my %IF statement in PROC REPORT to read:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%if %sysevalf(compute&amp;amp;j. = mincompute) %then %do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That seems to have fixed the error I was receiving, but I still can't get the highlighting to work.&amp;nbsp; That might be another post soon if I can't figure that part out.&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 15:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137517#M11076</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2014-07-25T15:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating Math Expressions with Macros</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137518#M11077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Just remember 2 things about highlighting:&lt;/P&gt;&lt;P&gt;1) if you are using ACROSS items, you have to use absolute column numbers in the CALL DEFINE for the highlighting&lt;/P&gt;&lt;P&gt; call define('_c4_','style','style={...}');&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;2) if you are highlighting, you must remember that PROC REPORT does *NOT* have a PDV. So you can only highlight what's been placed on the report row. For example:&lt;/P&gt;&lt;P&gt;column name age var1 var2 var3;&lt;/P&gt;&lt;P&gt;In a COMPUTE block for AGE (for example) you cannot "touch" VAR1, VAR2 or VAR3 with a CALL DEFINE statement. That's because when PROC REPORT is dealing with AGE, it has not yet put those vars on the report row yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 16:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Evaluating-Math-Expressions-with-Macros/m-p/137518#M11077</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-07-25T16:17:18Z</dc:date>
    </item>
  </channel>
</rss>

