<?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/611709#M178336</link>
    <description>&lt;P&gt;I closed/reopened the mail client and re-ran the code. It all works perfectly. Thank you very much for your help.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2019 19:32:32 GMT</pubDate>
    <dc:creator>jwdenham</dc:creator>
    <dc:date>2019-12-13T19:32:32Z</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/611663#M178305</link>
      <description>&lt;P&gt;Hello all, I was hoping to find some help regarding this macro. I am using it to generate emails to clients based on the values selected by the if statement. I plan to scale this up with more variables (i.e. tracking IDs, etc.) once I have it working, however I am receiving the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: More positional parameters found than defined.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble identifying the cause, and I am sure this would be a simple resolution for someone with more experience utilizing macros. I used the paper SAS3212-2019 in helping build it, and reviewed many other issues on these forums that were similar but not quite the same, however I attempted their resolutions with no avail. Any help would be very much appreciated. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro sendreports(name,email);&lt;BR /&gt;filename outbox EMAIL;&lt;BR /&gt;data _null_;&lt;BR /&gt;FILE outbox&lt;/P&gt;&lt;P&gt;to=("email@mail.com")&lt;BR /&gt;from=("email2@mail.com")&lt;BR /&gt;sender="email2@mail.com"&lt;BR /&gt;subject="Welcome &amp;amp;primaryemail.";&lt;/P&gt;&lt;P&gt;file outbox;&lt;BR /&gt;put "Message &amp;amp;name.";put ;&lt;BR /&gt;run;&lt;BR /&gt;%mend sendreports;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=tracker out=tracker2;&lt;BR /&gt;by ID Action;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set tracker3;&lt;BR /&gt;by ID Action;&lt;BR /&gt;if Action in ('1,2');&lt;BR /&gt;if first.ID then do;&lt;BR /&gt;call execute(cats('%sendreports(',name,',',email,')'));&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 17:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/611663#M178305</guid>
      <dc:creator>jwdenham</dc:creator>
      <dc:date>2019-12-13T17:37:09Z</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/611664#M178306</link>
      <description>&lt;P&gt;In data set TRACKER3, look at the values of variables name and email. Are there commas in these variables?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 17:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/611664#M178306</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-13T17:40: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/611668#M178307</link>
      <description>&lt;P&gt;Yes, the values in the name variable are in this format: Last, First&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 17:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/611668#M178307</guid>
      <dc:creator>jwdenham</dc:creator>
      <dc:date>2019-12-13T17:48: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/611670#M178308</link>
      <description>&lt;P&gt;That's the reason for the error. A comma signals the end of a "positional parameter" and so that comma in the name makes it appear as if you have assigned three positional parameters to a macro that has only two positional parameters.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    length name $ 64;
    set tracker3;
    by ID Action;
    if Action in ('1,2');
    name=tranwrd(name,',','%str(,)');
    if first.ID then do;
        call execute(cats('%sendreports(',name,',',email,')'));
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 18:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/611670#M178308</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-13T18:00:18Z</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/611675#M178313</link>
      <description>&lt;P&gt;This does allow the macro to process without error for only the name, however it seems to mask the second variable "email" and ignores it upon being sent. Cleaning up the name column does allow it to process once the "," is removed, though it would be ideal to use the method you provided if it didn't ignore the email variable in the process.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 18:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/611675#M178313</guid>
      <dc:creator>jwdenham</dc:creator>
      <dc:date>2019-12-13T18:15:55Z</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/611681#M178319</link>
      <description>&lt;P&gt;Show me a few lines of code generated by CALL EXECUTE as it appears in the LOG (and any error messages as well)&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/611681#M178319</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-13T19:14:39Z</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/611709#M178336</link>
      <description>&lt;P&gt;I closed/reopened the mail client and re-ran the code. It all works perfectly. Thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-More-positional-parameters-found-than-defined/m-p/611709#M178336</guid>
      <dc:creator>jwdenham</dc:creator>
      <dc:date>2019-12-13T19:32:32Z</dc:date>
    </item>
  </channel>
</rss>

