<?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 clarification in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252241#M47836</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25431"&gt;@varunk﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first error message ("&lt;FONT face="courier new,courier"&gt;A character operand was found in the %EVAL function&lt;/FONT&gt; ...") is due to the fact that %EVAL cannot cope with date literals. To store the numeric SAS date value corresponding to the date literal in the macro variable, you can use the %SYSEVALF function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let d=%sysevalf("24FEB2016"d);
%put &amp;amp;d;
/* 20508 */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Reeza explained the second error message ("&lt;FONT face="courier new,courier"&gt;Function name missing in %SYSFUNC&lt;/FONT&gt; ...").&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2016 22:01:45 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2016-02-24T22:01:45Z</dc:date>
    <item>
      <title>Macro Variable clarification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252084#M47756</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i submitt the below statements it gets resolved to February.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let %SYSFUNC(TODAY(), Monname.);&lt;/P&gt;
&lt;P&gt;Resolves to February&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However when i try to provide date value manually below statement gives error, Could you please let me know why it is giving error and how can it be resolved.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%Let D=%EVAL("24FEB2016"d);&lt;/P&gt;
&lt;P&gt;%PUT %SYSFUNC(&amp;amp;D,Monname.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Varun&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 17:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252084#M47756</guid>
      <dc:creator>varunk</dc:creator>
      <dc:date>2016-02-24T17:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable clarification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252090#M47761</link>
      <description>&lt;P&gt;%sysfunc requires a function in the first parameter and an optional format for the second parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're not using a function for the first parameter. If you use PUTN then you don't need the second parameter.&lt;/P&gt;
&lt;P&gt;This resolves as expected:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Let D="24FEB2016"d;
%put %sysfunc(putn(&amp;amp;d, monname.));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Feb 2016 17:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252090#M47761</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-24T17:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable clarification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252241#M47836</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25431"&gt;@varunk﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first error message ("&lt;FONT face="courier new,courier"&gt;A character operand was found in the %EVAL function&lt;/FONT&gt; ...") is due to the fact that %EVAL cannot cope with date literals. To store the numeric SAS date value corresponding to the date literal in the macro variable, you can use the %SYSEVALF function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let d=%sysevalf("24FEB2016"d);
%put &amp;amp;d;
/* 20508 */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Reeza explained the second error message ("&lt;FONT face="courier new,courier"&gt;Function name missing in %SYSFUNC&lt;/FONT&gt; ...").&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 22:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252241#M47836</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-24T22:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable clarification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252521#M47965</link>
      <description>&lt;P&gt;Thanks for all your help&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 19:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252521#M47965</guid>
      <dc:creator>varunk</dc:creator>
      <dc:date>2016-02-25T19:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable clarification</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252522#M47966</link>
      <description>&lt;P&gt;thanks for all your help.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 19:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-clarification/m-p/252522#M47966</guid>
      <dc:creator>varunk</dc:creator>
      <dc:date>2016-02-25T19:54:34Z</dc:date>
    </item>
  </channel>
</rss>

