<?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: Resolve psoitional paramters with macro variable variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Resolve-psoitional-paramters-with-macro-variable-variables/m-p/390290#M93594</link>
    <description>&lt;P&gt;&lt;SPAN&gt;ordby=age,event_name,event_date -&amp;gt; this is your issue.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The answer (from a decade ago) is here:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/kb/31/012.html" target="_blank"&gt;http://support.sas.com/kb/31/012.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2017 15:11:13 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-08-23T15:11:13Z</dc:date>
    <item>
      <title>Resolve psoitional paramters with macro variable variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-psoitional-paramters-with-macro-variable-variables/m-p/390288#M93593</link>
      <description>&lt;P&gt;I tried the following to resolve the three keyword parameters libname, dname and ordby.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so libname is passed &amp;amp;source is where the dataset(dname) events&amp;nbsp;is present,I want to sort them in the order age,event_name,event_date.&lt;/P&gt;&lt;P&gt;I;m getting the following error:&lt;/P&gt;&lt;P&gt;ERROR: All positional parameters must precede keyword parameters.&lt;/P&gt;&lt;P&gt;MLOGIC(DERIVE_SEQNUM): Ending execution.&lt;/P&gt;&lt;P&gt;180: LINE and COLUMN cannot be determined.&lt;/P&gt;&lt;P&gt;NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN&lt;/P&gt;&lt;P&gt;where the error has occurred.&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; derive_seqnum(libname=,dname=,ordby=);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;create table &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;dname.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;from &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;libname.&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;dname.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;order by &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ordby.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; derive_seqnum;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;derive_seqnum&lt;/I&gt;&lt;/STRONG&gt;(libname=&amp;amp;source,dname=events,ordby=age,event_name,event_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 15:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-psoitional-paramters-with-macro-variable-variables/m-p/390288#M93593</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2017-08-23T15:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve psoitional paramters with macro variable variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-psoitional-paramters-with-macro-variable-variables/m-p/390290#M93594</link>
      <description>&lt;P&gt;&lt;SPAN&gt;ordby=age,event_name,event_date -&amp;gt; this is your issue.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The answer (from a decade ago) is here:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/kb/31/012.html" target="_blank"&gt;http://support.sas.com/kb/31/012.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 15:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-psoitional-paramters-with-macro-variable-variables/m-p/390290#M93594</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-23T15:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve psoitional paramters with macro variable variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-psoitional-paramters-with-macro-variable-variables/m-p/390303#M93598</link>
      <description>&lt;P&gt;Sorry, its not entirely clear to me what this code is even to achieve? &amp;nbsp;It seems like you could simplfiy this down to:&lt;/P&gt;
&lt;PRE&gt;proc sort data=&amp;amp;source..events;
  by age event_name event_date;
run;&lt;/PRE&gt;
&lt;P&gt;The rest of it is just wasted characters. &amp;nbsp;Then you "could" - although I see no benefit and lots of pitfalls - of macro'ing the code;&lt;/P&gt;
&lt;PRE&gt;%macro Do_Sort (lib=,mem=,ord=);&lt;BR /&gt;  proc sort data=&amp;amp;lib..&amp;amp;mem.;
    by &amp;amp;ord.;
  run;&lt;BR /&gt;%mend Do_Sort;&lt;BR /&gt;&lt;BR /&gt;%Do_Sort (lib=&amp;amp;source.,mem=events,ord=age event_name event_date);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 15:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-psoitional-paramters-with-macro-variable-variables/m-p/390303#M93598</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-23T15:37:20Z</dc:date>
    </item>
  </channel>
</rss>

