<?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: The function LENGTH referenced by the %SYSFUNC or %QSYSFUNC macro function has too few ar in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387779#M24996</link>
    <description>&lt;P&gt;The easiest fix is probably this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %length(&amp;amp;var_va_date) &amp;gt; 0 %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, in macro language 0 is false and other integers are true.&amp;nbsp; So you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %length(&amp;amp;var_va_date) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, the %LENGTH function will actually return 0 for null strings (unlike the DATA step LENGTH function).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2017 14:12:40 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-08-14T14:12:40Z</dc:date>
    <item>
      <title>ERROR: The function LENGTH referenced by the %SYSFUNC or %QSYSFUNC macro function has too few argume</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387771#M24993</link>
      <description>&lt;P&gt;Hello - Having a nightmare with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just trying to parse 1 variable from VA into a SAS program, and for it to do something if&amp;nbsp;there's a value parsed in, and to do something else if there isn't one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run the below code though in EG, I get "ERROR: The function LENGTH referenced by the %SYSFUNC or %QSYSFUNC macro function has too few arguments", but I can't see what the problem is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help please!? We're not very good at the moment with passing&amp;nbsp;parameters in from Visual Analystics, and this is our first attempt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;rc = stpsrv_header('Content-disposition','attachment; filename=FTELoad.csv');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%global va_date;&lt;BR /&gt;%let _ODSSTYLE=seaside;&lt;BR /&gt;%let _ODSDEST=TAGSETS.CSV;&lt;/P&gt;&lt;P&gt;libname int meta library="Int" metaout=data;&lt;/P&gt;&lt;P&gt;%stpbegin;&lt;BR /&gt;%let var_va_date = &amp;amp;va_date;&lt;BR /&gt;%macro FTE(var_va_date);&lt;/P&gt;&lt;P&gt;%if (%sysfunc(length(&amp;amp;var_va_date)) &amp;gt;1) %then %do;&lt;BR /&gt;%put &amp;amp;var_va_date;&lt;BR /&gt;%put &amp;amp;va_date;&lt;/P&gt;&lt;P&gt;proc print data=int.intra label noobs;&lt;BR /&gt;where va_date = "&amp;amp;var_va_date." and report_type = 'Z';&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;proc print data=int.intra&lt;SPAN&gt;intra&amp;nbsp;&lt;/SPAN&gt;label noobs;&lt;BR /&gt;where va_date = 'Today' and report_type = 'Z';&lt;BR /&gt;%end;&lt;BR /&gt;%mend FTE;&lt;BR /&gt;%FTE(&amp;amp;var_va_date);&lt;BR /&gt;%stpend;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 13:50:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387771#M24993</guid>
      <dc:creator>ScottJP</dc:creator>
      <dc:date>2017-08-14T13:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The function LENGTH referenced by the %SYSFUNC or %QSYSFUNC macro function has too few ar</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387775#M24994</link>
      <description>&lt;P&gt;If &amp;amp;va_date is existing but empty, then&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%sysfunc(length(&amp;amp;var_va_date))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will resolve to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%sysfunc(length())&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and cause the error.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 14:07:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387775#M24994</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-14T14:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The function LENGTH referenced by the %SYSFUNC or %QSYSFUNC macro function has too few ar</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387778#M24995</link>
      <description>&lt;P&gt;This code works:&lt;/P&gt;
&lt;PRE&gt;%let var_va=ABCDEFGHIJKLMN;&lt;BR /&gt;&lt;BR /&gt;%macro tmp;&lt;BR /&gt; %if %sysfunc(length(&amp;amp;var_va.)) &amp;gt; 1 %then %put Ok;&lt;BR /&gt; %else %put Not;&lt;BR /&gt; %put %sysfunc(length(&amp;amp;var_va.));&lt;BR /&gt;%mend tmp;&lt;BR /&gt;&lt;BR /&gt;%tmp;&lt;/PRE&gt;
&lt;P&gt;Maybe post some more of the log where it happens (you could try dropping the brackets and adding the dot after the macro (should do this all the tie anyways, but it should matter in this case).&lt;/P&gt;
&lt;P&gt;What I suspect is happening is that &amp;amp;var_va. has something inside it that doesn't conform to the function signature, e.g.&lt;BR /&gt;ABC,DEF,GHI&lt;/P&gt;
&lt;P&gt;Would fail as the procedure does not want three parameters.&lt;/P&gt;
&lt;P&gt;As you have't shown what var_va resolves to its hard to say.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 14:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387778#M24995</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-14T14:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The function LENGTH referenced by the %SYSFUNC or %QSYSFUNC macro function has too few ar</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387779#M24996</link>
      <description>&lt;P&gt;The easiest fix is probably this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %length(&amp;amp;var_va_date) &amp;gt; 0 %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, in macro language 0 is false and other integers are true.&amp;nbsp; So you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %length(&amp;amp;var_va_date) %then %do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, the %LENGTH function will actually return 0 for null strings (unlike the DATA step LENGTH function).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 14:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387779#M24996</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-08-14T14:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The function LENGTH referenced by the %SYSFUNC or %QSYSFUNC macro function has too few ar</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387798#M24998</link>
      <description>&lt;P&gt;Great - thanks everyone. I've got this working now and it's helped prove a point for us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was to try to get around a problem we're seeing, where we THOUGHT that the paramater wasn't being parsed by Visual Analytics, but turns out that it is always being parsed.&amp;nbsp;&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-inline" image-alt="va_date.PNG" style="width: 99px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/14463i99405A2F7A7A997C/image-size/large?v=v2&amp;amp;px=999" role="button" title="va_date.PNG" alt="va_date.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code works fine now, but every 3rd or 4th time I double click the va_date in VA (see attached screenshot), instead of getting the data from the stored process (which works great&amp;nbsp;otherwise) I get a CSV with the log file which says No oberservations in data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't seem reliable, even though there are millions of rows in the dataset. If I pass through a different date each time, the problem seems less likely to occur. I can replicate the problem by choosing the same data twice - the first file will download fine and have thousands of rows, the second file will say no obs. I've tried different browsers in case it was a caching issue or something.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone had experience of this before as well please!? It's new territory here...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NOTE: No observations in data set INT.INTRANET_ENROL_LOAD.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;IMG border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 14:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-The-function-LENGTH-referenced-by-the-SYSFUNC-or-QSYSFUNC/m-p/387798#M24998</guid>
      <dc:creator>ScottJP</dc:creator>
      <dc:date>2017-08-14T14:54:40Z</dc:date>
    </item>
  </channel>
</rss>

