<?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 macros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477611#M123042</link>
    <description>&lt;P&gt;Hi I have three macros &amp;amp;a&amp;nbsp;, &amp;amp;b and &amp;amp;c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;a&amp;nbsp; and &amp;amp;b are character and &amp;amp;c is numeric.&lt;/P&gt;&lt;P&gt;I have to convert both&amp;nbsp;&amp;amp;a and &amp;amp;b to numeric and multiply&amp;nbsp; &amp;amp;b with &amp;amp;c.&lt;/P&gt;&lt;P&gt;&amp;amp;a I am going to use it for further calculations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all three macro variables include decimal values. Please help me.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 16:57:06 GMT</pubDate>
    <dc:creator>VISHNU239</dc:creator>
    <dc:date>2018-07-12T16:57:06Z</dc:date>
    <item>
      <title>macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477611#M123042</link>
      <description>&lt;P&gt;Hi I have three macros &amp;amp;a&amp;nbsp;, &amp;amp;b and &amp;amp;c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;a&amp;nbsp; and &amp;amp;b are character and &amp;amp;c is numeric.&lt;/P&gt;&lt;P&gt;I have to convert both&amp;nbsp;&amp;amp;a and &amp;amp;b to numeric and multiply&amp;nbsp; &amp;amp;b with &amp;amp;c.&lt;/P&gt;&lt;P&gt;&amp;amp;a I am going to use it for further calculations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all three macro variables include decimal values. Please help me.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 16:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477611#M123042</guid>
      <dc:creator>VISHNU239</dc:creator>
      <dc:date>2018-07-12T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477612#M123043</link>
      <description>%SYSEVALF(). Macro variables are text, not numeric/character. Please show a detailed example of what you’re looking for and why the approach suggested previously did not work.</description>
      <pubDate>Thu, 12 Jul 2018 17:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477612#M123043</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-12T17:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477623#M123050</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185592" target="_self"&gt;&lt;SPAN class=""&gt;VISHNU239&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should be okay to multiply the character variable with the numeric variable. SAS will automatically convert the character values into numeric then perform the operation. SAS will post a NOTE in the log to indicate the conversion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let f = '125';&lt;BR /&gt;%let g = '12.52';&lt;BR /&gt;%let h = 60;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;input a $ b $ c;&lt;BR /&gt;cards;&lt;BR /&gt;12 12.52 60&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test2;&lt;BR /&gt;set test;&lt;BR /&gt;d= &amp;amp;f * &amp;amp;h;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by:&lt;BR /&gt;(Line):(Column).&lt;BR /&gt;1:1&lt;BR /&gt;NOTE: There were 1 observations read from the data set WORK.TEST.&lt;BR /&gt;NOTE: The data set WORK.TEST2 has 1 observations and 4 variables.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 17:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477623#M123050</guid>
      <dc:creator>afafsafawa</dc:creator>
      <dc:date>2018-07-12T17:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477630#M123054</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209595"&gt;@afafsafawa&lt;/a&gt;&amp;nbsp;in general that wouldn't be considered a good approach, mostly because if you have errors later on that are the same as this warning it will not be detected. Additionally, this will put you in the habit of ignoring warnings/notes, but they can be really important. A clean log is a very good idea.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That being said, for quick and dirty calculations&amp;nbsp;or time constraints, I've done this as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209595"&gt;@afafsafawa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185592" target="_self"&gt;&lt;SPAN class=""&gt;VISHNU239&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be okay to multiply the character variable with the numeric variable. SAS will automatically convert the character values into numeric then perform the operation. SAS will post a NOTE in the log to indicate the conversion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see example below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let f = '125';&lt;BR /&gt;%let g = '12.52';&lt;BR /&gt;%let h = 60;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;input a $ b $ c;&lt;BR /&gt;cards;&lt;BR /&gt;12 12.52 60&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test2;&lt;BR /&gt;set test;&lt;BR /&gt;d= &amp;amp;f * &amp;amp;h;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by:&lt;BR /&gt;(Line):(Column).&lt;BR /&gt;1:1&lt;BR /&gt;NOTE: There were 1 observations read from the data set WORK.TEST.&lt;BR /&gt;NOTE: The data set WORK.TEST2 has 1 observations and 4 variables.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 17:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/477630#M123054</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-12T17:36:57Z</dc:date>
    </item>
  </channel>
</rss>

