<?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: More positional parameters found than defined. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94087#M19835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And all positional parameters have to come before named.&lt;/P&gt;&lt;P&gt;%macro dummy(var1, var2, var3= , var4=); in definition and&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;%dummy (value1, value2, var3=value3, var4=value4); the order or presence of var3 and var4 are optional as long as they come after var1 and var2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Oct 2012 14:43:57 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2012-10-15T14:43:57Z</dc:date>
    <item>
      <title>ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94085#M19833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running that the following code and I am getting the error above. The collateral macro seems to compile correctly and the increment variable assumes the correct valued; am I missing smth. Why am I getting this error when trying to run the %main macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%main();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro main();&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let increment=25000;&lt;/P&gt;&lt;P&gt;%collateral(&amp;amp;increment);&lt;/P&gt;&lt;P&gt;%mend main();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Maroulator&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 02:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94085#M19833</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2012-10-13T02:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94086#M19834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;You probably have some unbalanced quotes or parentheses somewhere and SAS is in a confused state.&amp;nbsp; Start a new session to get a fresh slate and see if it goes away.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;You seem to want to call the macro MAIN before it is defined, but that could just be the way the code got pasted into the posting.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;Otherwise there must be something happening in the COLLATERAL macro.&amp;nbsp; Try just calling it directly and see if you still get the same error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The most likely problem is that COLLATERAL is defined with named parameters and you are calling it with positional.&lt;/P&gt;&lt;P&gt;For example try this simple test to generate the same problem.&lt;/P&gt;&lt;P&gt;%macro mymac(x=);&lt;/P&gt;&lt;P&gt;%put x="&amp;amp;x";&lt;/P&gt;&lt;P&gt;%mend mymac;&lt;/P&gt;&lt;P&gt;%mymac(100);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to be able to call the macro without specifying the parameter names in the call then do not include the equal signs after the parameter names in the %MACRO statement.&lt;/P&gt;&lt;P&gt;Note that you can still call positional parameters using named syntax, you just can't do it the other way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 02:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94086#M19834</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-10-13T02:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94087#M19835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And all positional parameters have to come before named.&lt;/P&gt;&lt;P&gt;%macro dummy(var1, var2, var3= , var4=); in definition and&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;%dummy (value1, value2, var3=value3, var4=value4); the order or presence of var3 and var4 are optional as long as they come after var1 and var2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 14:43:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94087#M19835</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-10-15T14:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94088#M19836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And you can specify the parameter names for the positional parameters also in the macro call allowing you to list them in any order you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%dummy(var4=value4,var1=value1,var2=value2,var3=value3)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 15:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94088#M19836</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-10-15T15:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94089#M19837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="809901" data-username="maroulator" href="https://communities.sas.com/people/maroulator" id="jive-80990150800823056312803"&gt;maroulator&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side note, check the value you are passing in to you macros (Outer / Inner) either.&lt;/P&gt;&lt;P&gt;If the string value you passing happens to have a comma (,) in it, such as formatted numeric value, or single character value containing a comma.&lt;/P&gt;&lt;P&gt;In order to avoid issues with commas and other special characters that could exists in your data, try to use the following macro functions (%str(), %nrtstr(), %superq()) instead of using the bare &amp;amp;[Var] format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is applicable to positional and named macro parameters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 15:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/94089#M19837</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2012-10-15T15:13:37Z</dc:date>
    </item>
  </channel>
</rss>

