<?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 Macro Variables in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-Variables/m-p/2756#M1197</link>
    <description>I have a macro that recursivly runs some functions. I noticed that the macro variables are actually the functions themselves, instead of the values. Is there a way to force them to become values?&lt;BR /&gt;
&lt;BR /&gt;
For instance:&lt;BR /&gt;
&lt;BR /&gt;
%let x=1&lt;BR /&gt;
%let Piece1=(&amp;amp;x+1);&lt;BR /&gt;
%let Piece2=(&amp;amp;x+2);&lt;BR /&gt;
&lt;BR /&gt;
%let equation=(&amp;amp;Piece1/&amp;amp;Piece2);&lt;BR /&gt;
&lt;BR /&gt;
Now what I want is for equation to equal .666 ... what I get is (1+1)/(1+2) &lt;BR /&gt;
&lt;BR /&gt;
How can I force the variable to be the value instead of the equation? &lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
Noble</description>
    <pubDate>Tue, 10 Apr 2007 18:28:47 GMT</pubDate>
    <dc:creator>Ndclary</dc:creator>
    <dc:date>2007-04-10T18:28:47Z</dc:date>
    <item>
      <title>Macro Variables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-Variables/m-p/2756#M1197</link>
      <description>I have a macro that recursivly runs some functions. I noticed that the macro variables are actually the functions themselves, instead of the values. Is there a way to force them to become values?&lt;BR /&gt;
&lt;BR /&gt;
For instance:&lt;BR /&gt;
&lt;BR /&gt;
%let x=1&lt;BR /&gt;
%let Piece1=(&amp;amp;x+1);&lt;BR /&gt;
%let Piece2=(&amp;amp;x+2);&lt;BR /&gt;
&lt;BR /&gt;
%let equation=(&amp;amp;Piece1/&amp;amp;Piece2);&lt;BR /&gt;
&lt;BR /&gt;
Now what I want is for equation to equal .666 ... what I get is (1+1)/(1+2) &lt;BR /&gt;
&lt;BR /&gt;
How can I force the variable to be the value instead of the equation? &lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
Noble</description>
      <pubDate>Tue, 10 Apr 2007 18:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-Variables/m-p/2756#M1197</guid>
      <dc:creator>Ndclary</dc:creator>
      <dc:date>2007-04-10T18:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-Variables/m-p/2757#M1198</link>
      <description>You might take a look at the %SYSEVALF macro function, which evaluates an expression and returns a floating point result.&lt;BR /&gt;
&lt;BR /&gt;
   support.sas.com/onlinedoc/913/getDoc/en/mcrolref.hlp/a000206831.htm</description>
      <pubDate>Tue, 10 Apr 2007 18:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-Variables/m-p/2757#M1198</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2007-04-10T18:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-Variables/m-p/2758#M1199</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Also, if you use call symput instead of %let, then you can pass an expression or variable instead of a literal string. For example, instead of:&lt;BR /&gt;
&lt;BR /&gt;
%let equation=(&amp;amp;Piece1/&amp;amp;Piece2);&lt;BR /&gt;
&lt;BR /&gt;
you would use:&lt;BR /&gt;
&lt;BR /&gt;
call symput('equation',&amp;amp;piece1/&amp;amp;piece2);&lt;BR /&gt;
&lt;BR /&gt;
Please note that call symput only works within a data step, so you could do something like:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  call symput('equation',&amp;amp;piece1/&amp;amp;piece2);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Mark</description>
      <pubDate>Wed, 18 Apr 2007 15:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-Variables/m-p/2758#M1199</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-04-18T15:34:25Z</dc:date>
    </item>
  </channel>
</rss>

