<?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 How to correct: ERROR: All positional parameters must precede keyword parameters. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/503576#M134592</link>
    <description>&lt;P&gt;Hi All, I have a question about how to correct the error "All positional parameters must precede keyword parameters"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code is below, I did add %str function to the macro variable &amp;amp;SEG_LIST. when I call the macro FUNC_ALLSEG, but it didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is very straightforward. I have a macro variable SEGMENT_LIST, which stores a list of segments,&lt;/P&gt;&lt;P&gt;then for each segment, I use another macro FUNC1 to generate desirable results for that segment.&lt;/P&gt;&lt;P&gt;But still, I got error msg stated in the title line. Any ideas or thoughts are greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FUNC_ALLSEG( SEGMENT_LIST = );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; segnum = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(countw(&amp;amp;SEGMENT_LIST,&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%STR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(,)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%DO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; I=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;SEGNUM.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;FUNC1&lt;/I&gt;&lt;/STRONG&gt;(base = CX.BASEDATA, segment = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SCAN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;SEGMENT_LIST."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&amp;amp;I,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;","&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%END&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%MEND;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;FONT face="Courier New"&gt;FUNC_ALLSEG&lt;/FONT&gt;( SEGMENT_LIST=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%STR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;SEG_LIST.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2018 21:44:02 GMT</pubDate>
    <dc:creator>changxuosu</dc:creator>
    <dc:date>2018-10-11T21:44:02Z</dc:date>
    <item>
      <title>How to correct: ERROR: All positional parameters must precede keyword parameters.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/503576#M134592</link>
      <description>&lt;P&gt;Hi All, I have a question about how to correct the error "All positional parameters must precede keyword parameters"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code is below, I did add %str function to the macro variable &amp;amp;SEG_LIST. when I call the macro FUNC_ALLSEG, but it didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is very straightforward. I have a macro variable SEGMENT_LIST, which stores a list of segments,&lt;/P&gt;&lt;P&gt;then for each segment, I use another macro FUNC1 to generate desirable results for that segment.&lt;/P&gt;&lt;P&gt;But still, I got error msg stated in the title line. Any ideas or thoughts are greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FUNC_ALLSEG( SEGMENT_LIST = );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; segnum = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(countw(&amp;amp;SEGMENT_LIST,&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%STR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(,)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%DO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; I=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;SEGNUM.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;FUNC1&lt;/I&gt;&lt;/STRONG&gt;(base = CX.BASEDATA, segment = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SCAN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;SEGMENT_LIST."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&amp;amp;I,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;","&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%END&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%MEND;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;FONT face="Courier New"&gt;FUNC_ALLSEG&lt;/FONT&gt;( SEGMENT_LIST=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%STR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;SEG_LIST.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 21:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/503576#M134592</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2018-10-11T21:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to correct: ERROR: All positional parameters must precede keyword parameters.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/503577#M134593</link>
      <description>&lt;P&gt;see if this works&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO FUNC_ALLSEG( SEGMENT_LIST = );

%let segnum = %sysfunc(countw(&amp;amp;SEGMENT_LIST,%STR(,)));

%DO I=1 %TO &amp;amp;SEGNUM.;

%FUNC1(base = CX.BASEDATA, segment = %SCAN(%superq(SEGMENT_LIST),&amp;amp;I,%str(,) )

%END;

%MEND;

 

%FUNC_ALLSEG( SEGMENT_LIST=%STR(&amp;amp;SEG_LIST.))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Oct 2018 21:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/503577#M134593</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-11T21:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to correct: ERROR: All positional parameters must precede keyword parameters.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/503586#M134601</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/193702"&gt;@changxuosu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All, I have a question about how to correct the error "All positional parameters must precede keyword parameters"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code is below, I did add %str function to the macro variable &amp;amp;SEG_LIST. when I call the macro FUNC_ALLSEG, but it didn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want to do is very straightforward. I have a macro variable SEGMENT_LIST, which stores a list of segments,&lt;/P&gt;
&lt;P&gt;then for each segment, I use another macro FUNC1 to generate desirable results for that segment.&lt;/P&gt;
&lt;P&gt;But still, I got error msg stated in the title line. Any ideas or thoughts are greatly appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FUNC_ALLSEG( SEGMENT_LIST = );&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; segnum = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(countw(&amp;amp;SEGMENT_LIST,&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%STR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(,)));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%DO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; I=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;SEGNUM.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;FUNC1&lt;/I&gt;&lt;/STRONG&gt;(base = CX.BASEDATA, segment = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SCAN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;SEGMENT_LIST."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&amp;amp;I,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;","&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%END&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%MEND;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;FONT face="Courier New"&gt;FUNC_ALLSEG&lt;/FONT&gt;( SEGMENT_LIST=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%STR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;SEG_LIST.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does your &amp;amp;SEG_LIST variable contain commas? If so, why? In many cases you can use space separated lists. Countw and Scan will both use spaces for delimiters. If your individual segment values contain spaces and that is why you are using a comma then use a different character instead (update your countw and %scan to use the same). The comma is the delimeter for parameters of a macro call. Using a different character would remove that error.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 22:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/503586#M134601</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-11T22:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to correct: ERROR: All positional parameters must precede keyword parameters.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/504486#M135005</link>
      <description>&lt;P&gt;Thanks a lot for your comments!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 20:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/504486#M135005</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2018-10-15T20:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to correct: ERROR: All positional parameters must precede keyword parameters.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/504487#M135006</link>
      <description>thanks a lot for your comments!</description>
      <pubDate>Mon, 15 Oct 2018 20:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-correct-ERROR-All-positional-parameters-must-precede/m-p/504487#M135006</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2018-10-15T20:34:25Z</dc:date>
    </item>
  </channel>
</rss>

