<?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 New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574794#M12744</link>
    <description>&lt;P&gt;Thank's Paige. After using %bquote its working now and thanks a lot for clarifying the difference between %quote and %str.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jeetender&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2019 20:58:19 GMT</pubDate>
    <dc:creator>jeetendersinghc</dc:creator>
    <dc:date>2019-07-18T20:58:19Z</dc:date>
    <item>
      <title>ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574772#M12740</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Is there any way i can call macro variable demvar inside the key word macro .&lt;BR /&gt;Here is my code and when i am trying to run it I am getting the error :ERROR: More positional parameters found than defined."&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let demvar= x , y, z;
%put &amp;amp;demvar;




%macro table(indata, outdata, varlist );
Proc sql;
create table &amp;amp;outdata. as
select &amp;amp;varlist.
from &amp;amp;indata.
where patid in (select patid from ca)
order by patid;
quit;

%mend;
%table(a, b , (%str(&amp;amp;demvar));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My purpose of doing so is to create multiple dataset by changing name of variable of interest in demvar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeetender&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 20:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574772#M12740</guid>
      <dc:creator>jeetendersinghc</dc:creator>
      <dc:date>2019-07-18T20:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574773#M12741</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/126364"&gt;@jeetendersinghc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;Is there any way i can call macro variable demvar inside the key word macro .&lt;BR /&gt;Here is my code and when i am trying to run it I am getting the error :ERROR: More positional parameters found than defined."&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let demvar= x , y, z;
%put &amp;amp;demvar;




%macro table(indata, outdata, varlist );
Proc sql;
create table &amp;amp;outdata. as
select &amp;amp;varlist.
from &amp;amp;indata.
where patid in (select patid from ca)
order by patid;
quit;

%mend;
%table(a, b , (%str(&amp;amp;demvar));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My purpose of doing so is to create multiple dataset by changing name of variable of interest in demvar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jeetender&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%table(a,b,%quote(&amp;amp;demvar))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Generally speaking, you want to put the %quote function around a macro variable if it might contain special characters like the comma. In this situation, %str() doesn't help. You would use %str() when you are creating a string and you actually have to type the comma character (or other special character) and not have the comma be treated as having a special meaning like a delimiter, it then gets treated as plain text. Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%table(a,b,%str(x,y,z))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jul 2019 20:22:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574773#M12741</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-18T20:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574787#M12742</link>
      <description>As others have pointed out, this can be done.  But it would be much easier if you just removed the commas:&lt;BR /&gt;&lt;BR /&gt;%let demvar = x y z;&lt;BR /&gt;&lt;BR /&gt;Then you won't need any quoting functions such as %str.</description>
      <pubDate>Thu, 18 Jul 2019 20:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574787#M12742</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-07-18T20:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574791#M12743</link>
      <description>&lt;P&gt;i removed the comma's and still getting the error but this time "&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, !, !!, &amp;amp;, (, *,&lt;BR /&gt;**, +, ',', -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, AS, BETWEEN, CONTAINS, EQ,&lt;BR /&gt;EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN,&lt;BR /&gt;LENGTH, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||,&lt;BR /&gt;~, ~=.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;The value which i have mentioned in demvar are the list of variables which i need to keep in my table. so by removing the commas from these values seems wouldn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 20:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574791#M12743</guid>
      <dc:creator>jeetendersinghc</dc:creator>
      <dc:date>2019-07-18T20:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: More positional parameters found than defined.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574794#M12744</link>
      <description>&lt;P&gt;Thank's Paige. After using %bquote its working now and thanks a lot for clarifying the difference between %quote and %str.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jeetender&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 20:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-More-positional-parameters-found-than-defined/m-p/574794#M12744</guid>
      <dc:creator>jeetendersinghc</dc:creator>
      <dc:date>2019-07-18T20:58:19Z</dc:date>
    </item>
  </channel>
</rss>

