<?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: macro variable calculation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-calculation/m-p/102804#M21466</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Hai.Kuo:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the input. It works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2012 17:26:13 GMT</pubDate>
    <dc:creator>bigbigben</dc:creator>
    <dc:date>2012-07-09T17:26:13Z</dc:date>
    <item>
      <title>macro variable calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-calculation/m-p/102802#M21464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, guys:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to take the division operation on macro variables, but it does not work. Can you give me some idea how to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a simple example, I have a variable, xx=5 and I want to generate yy that yy=1/xx=.2. Both variables are macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let xx=5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let yy=1/%eval(&amp;amp;xx.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;yy.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The outcome is yy=0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to be the case that the division operation causing the trouble. I even tried %let zz=%eval(1/5). The outcome is still 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 17:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-calculation/m-p/102802#M21464</guid>
      <dc:creator>bigbigben</dc:creator>
      <dc:date>2012-07-09T17:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-calculation/m-p/102803#M21465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%let xx=5;&lt;/P&gt;&lt;P&gt;%let yy=%SYSEVALF(1/&amp;amp;xx);&lt;/P&gt;&lt;P&gt;%put yy=&amp;amp;yy;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%SYSEVALF will do floating, while %eval will only do integer. &lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 17:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-calculation/m-p/102803#M21465</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-07-09T17:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-calculation/m-p/102804#M21466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Hai.Kuo:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the input. It works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 17:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-calculation/m-p/102804#M21466</guid>
      <dc:creator>bigbigben</dc:creator>
      <dc:date>2012-07-09T17:26:13Z</dc:date>
    </item>
  </channel>
</rss>

