<?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: create sas macro var in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614342#M179560</link>
    <description>&lt;P&gt;Like the error message tells you you're using %sysfunc() without using a function.&lt;/P&gt;
&lt;P&gt;Code like below should do:&lt;/P&gt;
&lt;PRE&gt;%let xx = %eval(&amp;amp;fromdate.-1);&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Dec 2019 05:50:18 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-12-30T05:50:18Z</dc:date>
    <item>
      <title>create sas macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614339#M179559</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;I want to create a sas macro varaible xx and I get an error.&lt;BR /&gt;/*ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.*/&lt;BR /&gt;/*ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.*/&lt;/P&gt;
&lt;P&gt;When I create macro var YY I don't get error.&lt;BR /&gt;What is the problem with xx?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let fromdate=21775;/*This is sas value for date 14AUG2019*/

%let xx = %eval(%sysfunc(&amp;amp;fromdate.)-1);

%let yy = %eval(%sysfunc(today())-1);
/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Dec 2019 05:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614339#M179559</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-12-30T05:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: create sas macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614342#M179560</link>
      <description>&lt;P&gt;Like the error message tells you you're using %sysfunc() without using a function.&lt;/P&gt;
&lt;P&gt;Code like below should do:&lt;/P&gt;
&lt;PRE&gt;%let xx = %eval(&amp;amp;fromdate.-1);&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Dec 2019 05:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614342#M179560</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-30T05:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: create sas macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614362#M179567</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="page" title="Page 217"&gt;
&lt;DIV class="layoutArea"&gt;
&lt;DIV class="column"&gt;
&lt;DIV class="page" title="Page 217"&gt;
&lt;DIV class="layoutArea"&gt;
&lt;DIV class="column"&gt;
&lt;P&gt;&lt;SPAN&gt;The %SYSFUNC() function enables to use&lt;/SPAN&gt;&amp;nbsp;SAS functions with macro variables.&lt;/P&gt;
&lt;P&gt;In your example, the %SYSFUNC() function enables to use the TODAY() function. Look at the difference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture d’écran 2019-12-30 à 10.23.39.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35081i89C30CAA9F050681/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture d’écran 2019-12-30 à 10.23.39.png" alt="Capture d’écran 2019-12-30 à 10.23.39.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in your example with xx, the %SYSFUNC() function is not associated with any SAS function. So that makes no sense.&lt;/P&gt;
&lt;P&gt;The syntax should be just:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let xx = %eval(&amp;amp;fromdate.-1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Dec 2019 09:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614362#M179567</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-30T09:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: create sas macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614363#M179568</link>
      <description>&lt;P&gt;Maxim 1: Read the Documentation.&lt;/P&gt;
&lt;P&gt;In this case, of the&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;%SYSFUNC&lt;/A&gt;&amp;nbsp;macro function. You will see that the first argument to %sysfunc has to be a function. Since &amp;amp;fromdate resolves to a literal and not a function name, your %sysfunc call fails.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 09:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-sas-macro-var/m-p/614363#M179568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-30T09:38:30Z</dc:date>
    </item>
  </channel>
</rss>

