<?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 create a 'simulation' with multiple automatic iterations? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81083#M17468</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if anyone could help me out with the following question. I've written a program in Base 9 with multiple data steps (and proc prints / reports). The outcome is based on the input variables, as stated at the beginning of the program (the &amp;amp;LET statements). Maybe useful to mention: in the datasteps itself, there are several other macro's created by the CALL SYMPUT statement (but these macro's are part of the calculations in the datastep, nothing else).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to run like 10.000 simulations (so different %LET statements). Is there a way to do this? Creating another dataset with the variables of each %LET statement and make the whole thing just 1 macro with another CALL SUMPUT? Or is this not possible? Thanks for your answer in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Input variables new system*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Let example1='1';&lt;/P&gt;&lt;P&gt;%Let example2='5';&lt;/P&gt;&lt;P&gt;%Let example3='20';&lt;/P&gt;&lt;P&gt;%Let example4='35';&lt;/P&gt;&lt;P&gt;%Let example5='0';&lt;/P&gt;&lt;P&gt;%Let example6='3';&lt;/P&gt;&lt;P&gt;%Let example7='5';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Datastep 1&lt;/P&gt;&lt;P&gt;Proc Print 1&lt;/P&gt;&lt;P&gt;Data step 2&lt;/P&gt;&lt;P&gt;Proc Print 2&lt;/P&gt;&lt;P&gt;Etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Sep 2012 14:39:47 GMT</pubDate>
    <dc:creator>Wouter</dc:creator>
    <dc:date>2012-09-30T14:39:47Z</dc:date>
    <item>
      <title>How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81083#M17468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if anyone could help me out with the following question. I've written a program in Base 9 with multiple data steps (and proc prints / reports). The outcome is based on the input variables, as stated at the beginning of the program (the &amp;amp;LET statements). Maybe useful to mention: in the datasteps itself, there are several other macro's created by the CALL SYMPUT statement (but these macro's are part of the calculations in the datastep, nothing else).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to run like 10.000 simulations (so different %LET statements). Is there a way to do this? Creating another dataset with the variables of each %LET statement and make the whole thing just 1 macro with another CALL SUMPUT? Or is this not possible? Thanks for your answer in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Input variables new system*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Let example1='1';&lt;/P&gt;&lt;P&gt;%Let example2='5';&lt;/P&gt;&lt;P&gt;%Let example3='20';&lt;/P&gt;&lt;P&gt;%Let example4='35';&lt;/P&gt;&lt;P&gt;%Let example5='0';&lt;/P&gt;&lt;P&gt;%Let example6='3';&lt;/P&gt;&lt;P&gt;%Let example7='5';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Datastep 1&lt;/P&gt;&lt;P&gt;Proc Print 1&lt;/P&gt;&lt;P&gt;Data step 2&lt;/P&gt;&lt;P&gt;Proc Print 2&lt;/P&gt;&lt;P&gt;Etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 14:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81083#M17468</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2012-09-30T14:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81084#M17469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... here are some ideas (I'm sure you'll get lots of suggestions) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could put those 10,000 values in a data set then uses something like ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* fake data ... put 5 values in a data set;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data x;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;do _n_=1 to 5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; value = ceil(100*ranuni(999));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; output;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* create a macro that reads the data set one observation per iteration of a loop;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* create a new macro variable at each iteration ... your code goes between %end and %mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%macro iterations;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%do j=1 %to 5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;j;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; set x point=nrec;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; call symputx("example&amp;amp;j",value);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* look at the LOG;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%put &lt;STRONG style="font-family: 'courier new', courier;"&gt;at iteration %j&lt;/STRONG&gt; macro variable example&amp;amp;j value is &amp;amp;&amp;amp;example&amp;amp;j;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%iterations;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;or ... do you really need a new macro variable each time or just the same macro variable with a new value at each iteration ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* give the same macro variable a new value at each iteration;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* your code goes between %end and %mend;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%macro iterations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%do j=1 %to 5;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;j;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; set x point=nrec;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; call symputx("example",value);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* look at the LOG;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%put at iteration %j macro variable example value is &amp;amp;example;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you just need a random number at each iteration of the loop ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* new value for macro variable generated at each iteration of the loop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* your code goes inside the macro loop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%macro iterations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%do j=1 %to 5;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%let example = %sysfunc(ceil(100*%sysfunc(ranuni(999))));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration %j macro variable example value is &amp;amp;example;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 15:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81084#M17469</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-09-30T15:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81085#M17470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;Thanks for your answer! And I assume I can use multiple call symput statements below each other?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;%do j=1 %to 5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;j;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; set x point=nrec;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; call symputx("example&amp;amp;j",value);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 18:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81085#M17470</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2012-09-30T18:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81086#M17471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ...yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 18:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81086#M17471</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-09-30T18:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81087#M17472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 19:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81087#M17472</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2012-09-30T19:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81088#M17473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you care about efficiency, you might want to look at the article &lt;A class="active_link" href="http://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way/" title="http://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way/"&gt;Simulation in SAS&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 13:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81088#M17473</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-10-01T13:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81089#M17474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, maybe you can help me one more time with this problem. I've got a dataset with round about 8 different variables (50k on rows or someting) and I want to run a simulation using this file. How can I create a simulation with different 'Symputs' at one time? Changing the code in something like beneath doesn't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%macro iterations;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; SET SIMULATION_SAMPLE_SET;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;j;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;x;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;y;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; set x point=nrec;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; call symputx("example&amp;amp;j",value);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; call symputx("example&amp;amp;x",value);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; call symputx("example&amp;amp;y",value);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; etc.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;* look at the LOG;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%put &lt;STRONG style="font-family: 'courier new', courier;"&gt;at iteration %j&lt;/STRONG&gt; macro variable example&amp;amp;j value is &amp;amp;&amp;amp;example&amp;amp;j;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%put &lt;STRONG style="font-family: 'courier new', courier;"&gt;at iteration %x&lt;/STRONG&gt; macro variable example&amp;amp;j value is &amp;amp;&amp;amp;example&amp;amp;x;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%put &lt;STRONG style="font-family: 'courier new', courier;"&gt;at iteration %y&lt;/STRONG&gt; macro variable example&amp;amp;j value is &amp;amp;&amp;amp;example&amp;amp;y;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;%iterations;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 15:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81089#M17474</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2012-10-01T15:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81090#M17475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... still not exactly sure what you are doing, but this gives new values to three macro variables at each iteration&lt;/P&gt;&lt;P&gt;the values are based on data provided from your data set ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also, I would read the reference cited by Rick Wilkin ... &lt;A class="active_link" href="http://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way/" title="http://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way/"&gt;Simulation in SAS&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also worth reading is&amp;nbsp; ... Don't Be Loopy: Re-Sampling and Simulation the SAS® Way ... &lt;A href="http://www2.sas.com/proceedings/forum2007/183-2007.pdf" title="http://www2.sas.com/proceedings/forum2007/183-2007.pdf"&gt;http://www2.sas.com/proceedings/forum2007/183-2007.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data SIMULATION_SAMPLE_SET;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;input x y z;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1 2 3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;4 5 6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;7 8 9&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%macro iterations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%do j=1 %to 3;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;j;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; set SIMULATION_SAMPLE_SET point=nrec;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; call symputx("xx",x);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; call symputx("xy",y);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; call symputx("xz",z);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* look at the LOG;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable xx value is &amp;amp;xx;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable yy value is &amp;amp;yy;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable zz value is &amp;amp;zz;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%iterations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;you could also try PROC SQL to generate the macro variables (the separated by clauses trim the values of the macro variable, if you have V9.3 you can substitute the option TRIMMED for the clause SEPARATED BY ' ') ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%macro iterations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%do j=1 %to 3;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc sql noprint;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;select x, y, z into &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;:xx separated by '', &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;:yy separated by '', &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;:zz separated by '' &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;from SIMULATION_SAMPLE_SET (firstobs=&amp;amp;j obs=&amp;amp;j);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* look at the LOG;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable xx value is &amp;amp;xx;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable yy value is &amp;amp;yy;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable zz value is &amp;amp;zz;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 18:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81090#M17475</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-10-01T18:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81091#M17476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again! But what I'm trying to do is to fill the %LET statements at the top of my code with a huge amount of figures from a dataset. From there, I need the outcome from the input from the dataset, and the output of the datasets I've already made. In words: I've created several datasets which contains macro's, and I want to test this program. For this, I want to use a dataset with multiple variables. The outcome should be the variables from the external file, and the output of my own written file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use and adapt the code below, but I can't get the output from my own file combined with these data. Do you have any idea? My file contains several other named macro's inside also which can be used as output in each loop, I thought, by using a %put in my own files. But this don't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%macro iterations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%do j=1 %to 3;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; nrec = &amp;amp;j;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; set SIMULATION_SAMPLE_SET point=nrec;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; call symputx("xx",x);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; call symputx("xy",y);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; call symputx("xz",z);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* look at the LOG;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable xx value is &amp;amp;xx;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable yy value is &amp;amp;yy;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%put at iteration &amp;amp;j macro variable zz value is &amp;amp;zz;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;Data test;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if A=B then C=4;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;Else...&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;etc...&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;call symput('testtest',C);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;%iterations&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 13:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81091#M17476</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2012-10-02T13:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81092#M17477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wouter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As difficult as it may be for you to believe, your requirements are still only partially clear.&amp;nbsp; I suspect that CALL EXECUTE would be a valuable tool here.&amp;nbsp; Here's a simplified version, based on the your first three values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let example1='1';&lt;/P&gt;&lt;P&gt;%let example2='5';&lt;/P&gt;&lt;P&gt;%let example3='20';&lt;/P&gt;&lt;P&gt;For illustration purposes, suppose this needs to generate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=dataset1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=dataset5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=dataset20;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how CALL EXECUTE would approach the task, by putting the three values into a DATA step instead of macro variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;input example $;&lt;/P&gt;&lt;P&gt;call execute ('proc print data=dataset' || strip(example) || '; run;');&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;20&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realize the code you are trying to generate will be a whole lot more complex than a PROC PRINT, and that the values within the DATA step will do more than identify which data set to process.&amp;nbsp; Still, the approach is likely to be helpful.&amp;nbsp; If you post more of what you are trying to do, we can work out how to make it happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 13:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81092#M17477</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-10-02T13:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81093#M17478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is not what I mean. I've written a code, which calculates several values, based on its input. The input is given, right now, by the %LET statements above the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%LET X=1&lt;/P&gt;&lt;P&gt;%LET Y=2&lt;/P&gt;&lt;P&gt;%LET B=3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code contains just some datasteps, which uses the variables as created by the %LET statements.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data test1;&lt;/P&gt;&lt;P&gt;A = &amp;amp;X*20;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc print data=test1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code also contains some macro's which are created &lt;STRONG&gt;inside&lt;/STRONG&gt; the code, like:&lt;/P&gt;&lt;P&gt;Data test2;&lt;/P&gt;&lt;P&gt;B = Y*30;&lt;/P&gt;&lt;P&gt;Call symput ('tester',F)&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This macro is used again in other datasteps within the same program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run this program, I get a list (all the proc print statements below each other), based on the values which are given by the %LET statements above the program. To test the program, I want to use an external SAS file which contain values for those %LET statements. But &lt;STRONG&gt;how&lt;/STRONG&gt; can I run the program and get the output of &lt;STRONG&gt;all&lt;/STRONG&gt; the values as presented in the external SAS file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the solution should be near, I get a logfile with all the different %LET statements from the external datafile, but I need also the variables that are created by my own program add to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, when I get the output:&lt;/P&gt;&lt;P&gt;X=1&lt;/P&gt;&lt;P&gt;Y=2&lt;/P&gt;&lt;P&gt;B=3&lt;/P&gt;&lt;P&gt;I also need the output (calculations) added from my own datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 13:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81093#M17478</guid>
      <dc:creator>Wouter</dc:creator>
      <dc:date>2012-10-02T13:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a 'simulation' with multiple automatic iterations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81094#M17479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We might be closer than you think.&amp;nbsp; Consider ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you get to the point of issuing this statement, there are alternatives:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call symput('tester', F);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using CALL SYMPUT, you could use CALL EXECUTE.&amp;nbsp; The value of F, as well as all existing macro variables, would be available to help CALL EXECUTE generate the proper SAS steps. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The process would change.&amp;nbsp; Instead of accumulating all the tests, each current iteration would generate one test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this make any sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 14:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-simulation-with-multiple-automatic-iterations/m-p/81094#M17479</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-10-02T14:11:53Z</dc:date>
    </item>
  </channel>
</rss>

