<?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: Proc GA macro calls in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-GA-macro-calls/m-p/630618#M3015</link>
    <description>&lt;P&gt;It's true that you can't execute SAS procedures directly from within your PROC GA objective function. The key is to create a macro that calls the procedures you wish to execute. Then, in your objective function definition you can call the macro with the 'run_macro' function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following SGF paper from 2013 demonstrates how to use run_macro from within a function definition:&lt;A href="https://support.sas.com/resources/papers/proceedings13/033-2013.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings13/033-2013.pdf&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2020 13:01:28 GMT</pubDate>
    <dc:creator>StevenGardner</dc:creator>
    <dc:date>2020-03-09T13:01:28Z</dc:date>
    <item>
      <title>Proc GA macro calls</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-GA-macro-calls/m-p/629494#M2976</link>
      <description>&lt;P&gt;I am writing a genetic algorithm implementation from python and I need to call some sas procedures inside the ObjectFunction that i am defining. For example when i try to use&lt;/P&gt;&lt;P&gt;proc compare base=selected_row compare=evolving_individual outstats=compare_result noprint;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;inside my objective function i get an error saying&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: Subroutine 'fitness_sso' was not terminated with ENDSUB.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Execution terminating because of previous errors.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;If i remove the call in my objective function to the 'proc compare' then the genetic algorithm runs to completion.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Any suggestions how i can call procedures inside the objective function? What about my own defined macros? If i reference my own macro like so %macro_call(var1, var2); then i also get the same error of the objective function not termintated with ENDSUB...&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Thanks for any help on this, but there is just not enough documentation and examples on genetic algorithm implementation.&lt;/DIV&gt;</description>
      <pubDate>Wed, 04 Mar 2020 16:56:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-GA-macro-calls/m-p/629494#M2976</guid>
      <dc:creator>BroniusBaniulis</dc:creator>
      <dc:date>2020-03-04T16:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc GA macro calls</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-GA-macro-calls/m-p/630618#M3015</link>
      <description>&lt;P&gt;It's true that you can't execute SAS procedures directly from within your PROC GA objective function. The key is to create a macro that calls the procedures you wish to execute. Then, in your objective function definition you can call the macro with the 'run_macro' function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following SGF paper from 2013 demonstrates how to use run_macro from within a function definition:&lt;A href="https://support.sas.com/resources/papers/proceedings13/033-2013.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings13/033-2013.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 13:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-GA-macro-calls/m-p/630618#M3015</guid>
      <dc:creator>StevenGardner</dc:creator>
      <dc:date>2020-03-09T13:01:28Z</dc:date>
    </item>
  </channel>
</rss>

