<?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: Repeated Macro Calls Giving Different Results in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446894#M112206</link>
    <description>&lt;P&gt;Hidden side effect. One of your macro variables you assume to be local might be global. Or a dataset that you assume to he static is actually changed.&lt;/P&gt;
&lt;P&gt;Without code, and data to test it against, we can only guess.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2018 17:55:22 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-03-19T17:55:22Z</dc:date>
    <item>
      <title>Repeated Macro Calls Giving Different Results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446871#M112195</link>
      <description>&lt;P&gt;I'm a peculiar situation where I appear to get different results&amp;nbsp;from a particular macro if the macro is called first in the code versus if it's called later in the code (presumably after the macro has been called with other parameters). I would generally expect a macro to return the same results if giving identical parameters.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't been able to reproduce this "error" in a more controlled manner (hence the lack of test code), but my macro uses PROC LOGISTIC to create a model from a subset of my data, save the results (list of variables, etc) to a given "total" dataset, The intention is for the macro to be run several times to work on different subsets of the data and append the results to that same "total"&amp;nbsp;dataset for later output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips on troubleshooting this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do sincerely apologize for the unorthodox question without proper test code, but I appreciate any suggestions/tips.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 17:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446871#M112195</guid>
      <dc:creator>ImSpartacus</dc:creator>
      <dc:date>2018-03-19T17:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated Macro Calls Giving Different Results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446880#M112197</link>
      <description>&lt;P&gt;Things to check - the scope of your macro variables. Are you accidentally setting/resetting something?&lt;/P&gt;
&lt;P&gt;Or modifying your data at some point and then running your model? Are you using a model selection method?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 17:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446880#M112197</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-19T17:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated Macro Calls Giving Different Results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446881#M112198</link>
      <description>&lt;P&gt;When you say "several subsets" of the data, I'm picturing randomly selected subsets.&amp;nbsp; That could automatically make the results slightly different each time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even if you are controlling the seed for the random selector, the data set may be different.&amp;nbsp; For example, it may be sorted differently later in the program, causing the random selection to choose a different sample (even when the seed has not changed).&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 17:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446881#M112198</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-19T17:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated Macro Calls Giving Different Results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446885#M112202</link>
      <description>&lt;P&gt;In this particular situation, I'm using a relatively simple "filtering" method, but as a side note, I do use have a similar macro that does randomly subset data, and I didn't know about the effect of&amp;nbsp;sorting on random selection (despite using the same seed). I'll have to remember that!&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your thoughts!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 19:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446885#M112202</guid>
      <dc:creator>ImSpartacus</dc:creator>
      <dc:date>2018-03-19T19:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated Macro Calls Giving Different Results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446894#M112206</link>
      <description>&lt;P&gt;Hidden side effect. One of your macro variables you assume to be local might be global. Or a dataset that you assume to he static is actually changed.&lt;/P&gt;
&lt;P&gt;Without code, and data to test it against, we can only guess.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 17:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/446894#M112206</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-19T17:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Repeated Macro Calls Giving Different Results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/447286#M112315</link>
      <description>Thanks for your thoughts.&lt;BR /&gt;&lt;BR /&gt;It turned out that I WASN'T resetting a particular dataset of potential regression variables that was being appended. So everything worked, but the forward selection had "too many" variables to pick from in the macro calls that ran later on in the program.&lt;BR /&gt;&lt;BR /&gt;I appreciate the feedback from everyone and I genuinely wish I could pick you all!</description>
      <pubDate>Wed, 21 Mar 2018 01:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeated-Macro-Calls-Giving-Different-Results/m-p/447286#M112315</guid>
      <dc:creator>ImSpartacus</dc:creator>
      <dc:date>2018-03-21T01:13:17Z</dc:date>
    </item>
  </channel>
</rss>

