<?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: All positional parameters must precede keyword parameters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/All-positional-parameters-must-precede-keyword-parameters/m-p/490171#M128170</link>
    <description>&lt;P&gt;You get this error because all your parameters are positionnal parameters and you are trying to address some of them as name parameters (i.e.: line_index&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Aug 2018 17:01:45 GMT</pubDate>
    <dc:creator>ybolduc</dc:creator>
    <dc:date>2018-08-27T17:01:45Z</dc:date>
    <item>
      <title>All positional parameters must precede keyword parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-positional-parameters-must-precede-keyword-parameters/m-p/490166#M128169</link>
      <description>&lt;P&gt;Hi all ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached my code below. I am unable to resolve the MACRO error :All positional parameters must precede keyword parameters&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro prior_reg(dataset,cohort,whrcls,linenumber,title);
		
		*where line numebr at index is either 1 ,2 or ge 3;
		data &amp;amp;dataset.&amp;amp;linenumber. ;
			set &amp;amp;cohort.;
			where &amp;amp;whrcls.;
		run ;

		*the regimen immediately prior to the index regimen will be reported for patients with an line number at index of 1,2 or ge 3;
		proc sql;
			create table &amp;amp;dataset._reg&amp;amp;linenumber. as 
			select distinct a.PatientID,a.index_date,a.line_index,b.StartDate,b.LineName,b.LineNumber
			from &amp;amp;dataset.&amp;amp;linenumber. as a
			left join dfi_panc.Lineoftherapy as b
			on a.PatientID =b.PatientID and (b.StartDate lt a.index_date)
			order by a.PatientID, b.StartDate ;
		quit ;/*244*/
	
		*taking the regimen immediately before the index date ;
		data &amp;amp;dataset._last_reg&amp;amp;linenumber.;
			set  &amp;amp;dataset._reg&amp;amp;linenumber.;
			by PatientID StartDate;
			if last.PatientID ;
		run ;
		
		proc freq data =&amp;amp;dataset._last_reg&amp;amp;linenumber.;
			tables LineName /out= &amp;amp;dataset.prior_reg&amp;amp;linenumber.;
		run ;
		
		ods csv file ="/data1/projects/IPS/IPS_19/results/''&amp;amp;dataset.'.csv";
				
			proc print data = &amp;amp;dataset.prior_reg&amp;amp;linenumber. ;
				title &amp;amp;title.;
			run ;
				
		ods csv close ;	

%mend prior_reg;
%prior_reg(_03a_folfiri,derived._00a_cohort_folfiri,1,line_index=1,'folfiri-1');
%prior_reg(_03a_folfiri,derived._00a_cohort_folfiri,2,line_index=2,'folfiri-2');
%prior_reg(_03a_folfiri,derived._00a_cohort_folfiri,3,line_index ge 3,'folfiri-3');
%prior_reg(_03a_folfiri,derived._00a_cohort_folfiri,4,PatientID ne '  ' ,'folfiri-4');
%prior_reg(_03b_folfox,derived._00b_cohort_folfox,1,line_index=1,'folfox-1');
%prior_reg(_03b_folfox,derived._00b_cohort_folfox,2,line_index=2,'folfox-2');
%prior_reg(_03b_folfox,derived._00b_cohort_folfox,3,line_index ge 3,'folfox-3');
%prior_reg(_03b_folfox,derived._00b_cohort_folfox,4,PatientID ne '  ','folfox-4');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Aug 2018 16:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-positional-parameters-must-precede-keyword-parameters/m-p/490166#M128169</guid>
      <dc:creator>manya92</dc:creator>
      <dc:date>2018-08-27T16:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: All positional parameters must precede keyword parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-positional-parameters-must-precede-keyword-parameters/m-p/490171#M128170</link>
      <description>&lt;P&gt;You get this error because all your parameters are positionnal parameters and you are trying to address some of them as name parameters (i.e.: line_index&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 17:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-positional-parameters-must-precede-keyword-parameters/m-p/490171#M128170</guid>
      <dc:creator>ybolduc</dc:creator>
      <dc:date>2018-08-27T17:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: All positional parameters must precede keyword parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/All-positional-parameters-must-precede-keyword-parameters/m-p/490172#M128171</link>
      <description>&lt;P&gt;Run your macro with MPRINT and SYMBOLGEN on and post the results from the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is likely the issue as SAS would interpre that as trying to pass as a parameter. You can try masking it with macro masking functions.&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;line_index&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 17:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/All-positional-parameters-must-precede-keyword-parameters/m-p/490172#M128171</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-27T17:02:05Z</dc:date>
    </item>
  </channel>
</rss>

