<?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: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584723#M166585</link>
    <description>&lt;P&gt;Here is the culprit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%sysfunc(&amp;amp;var1)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There is no need to apply %SYSFUNC to &amp;amp;VAR1, since there is no function being used.&amp;nbsp; Just remove that particular %SYSFUNC.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2019 18:36:01 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-08-28T18:36:01Z</dc:date>
    <item>
      <title>ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584709#M166575</link>
      <description>&lt;P&gt;Hi There,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying set up the following variable for a daily process&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let most_recent_file = data_201907;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;such that "_201907" is based on the most recent data file available. The file is generated mid month every month, for the prior month's data. Example today is Aug 16 til Sep 15, I will use data_201907. From Sep 16 til Oct 15 I will use data_201908 etc. So I thought the logic should be something along the lines of: take today. Subtract 2 weeks. Then subtract 1 month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let today = %sysfunc(today(), yymmddn8.);&lt;BR /&gt;%put &amp;amp;today. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let var1 = %sysfunc(intnx(week,%sysfunc(today()),-2,same),yymmddn8.);&lt;BR /&gt;%put &amp;amp;var1.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let var2 = %sysfunc(intnx(month,%sysfunc(&amp;amp;var1),-1,same),yymmn6.);&lt;BR /&gt;%put &amp;amp;var2.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm getting&amp;nbsp;ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing something really simple?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584709#M166575</guid>
      <dc:creator>HYC876</dc:creator>
      <dc:date>2019-08-28T18:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584719#M166582</link>
      <description>&lt;P&gt;%SYSFUNC executes a sas base function, but what does&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;today(), yymmddn8.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;mean in sas base ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably want:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%sysfunc(put(today(), yymmddn8.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584719#M166582</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-08-28T18:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584721#M166584</link>
      <description>&lt;P&gt;The first 2 parts are working. the last part "var2" is where I'm getting the error.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584721#M166584</guid>
      <dc:creator>HYC876</dc:creator>
      <dc:date>2019-08-28T18:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584723#M166585</link>
      <description>&lt;P&gt;Here is the culprit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%sysfunc(&amp;amp;var1)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There is no need to apply %SYSFUNC to &amp;amp;VAR1, since there is no function being used.&amp;nbsp; Just remove that particular %SYSFUNC.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584723#M166585</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-08-28T18:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584726#M166588</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your second statement you successfully set &amp;amp;var=20190814.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that inside the third statement you have&amp;nbsp;&lt;SPAN&gt;%sysfunc(&amp;amp;var1).&amp;nbsp; That doesn't work because %sysfunc() is used to call a function.&amp;nbsp; To do what you want, you could use %SYSFUNC to call the INPUTN function to convert 20190814 into a SAS date, e.g.:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var2 = %sysfunc(intnx(month,%sysfunc(inputn(&amp;amp;var1,yymmdd8.)),-1,same),yymmn6.);
%put &amp;amp;var2.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;That said, it looks like the formula could be today's date minus 15 days, then one month before that.&amp;nbsp; You can do that in one line, like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mydate=%sysfunc(intnx(month
                          ,%sysfunc(today())-15
                          ,-1
                           )
                    ,yymmn6.
                    );
%put &amp;amp;=mydate ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584726#M166588</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-08-28T18:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584727#M166589</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let today = %sysfunc(today(), yymmddn8.);
%put &amp;amp;today. ;

 

%let var1 = %sysfunc(intnx(week,%sysfunc(today()),-2,same),yymmddn8.);
%put &amp;amp;var1.;

 

%let var2 = %sysfunc(intnx(month,%sysfunc(inputn(&amp;amp;var1,yymmdd8.)),-1,same),yymmn6.);
%put &amp;amp;var2.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584727#M166589</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-28T18:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584730#M166592</link>
      <description>&lt;P&gt;I've tried that too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;got this:&amp;nbsp;WARNING: An argument to the function INTNX referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set&lt;BR /&gt;to a missing value.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584730#M166592</guid>
      <dc:creator>HYC876</dc:creator>
      <dc:date>2019-08-28T18:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584731#M166593</link>
      <description>&lt;P&gt;This also works!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584731#M166593</guid>
      <dc:creator>HYC876</dc:creator>
      <dc:date>2019-08-28T18:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584732#M166594</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Function-name-missing-in-SYSFUNC-or-QSYSFUNC-macro/m-p/584732#M166594</guid>
      <dc:creator>HYC876</dc:creator>
      <dc:date>2019-08-28T18:43:40Z</dc:date>
    </item>
  </channel>
</rss>

