<?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: Outputting macro elements for each iteration of a do loop to a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93716#M19761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this seems to be working. Thanks a bunch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Apr 2013 16:12:45 GMT</pubDate>
    <dc:creator>Xamius32</dc:creator>
    <dc:date>2013-04-01T16:12:45Z</dc:date>
    <item>
      <title>Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93705#M19750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is probably very simple, but right now I am running something that gives me a total number of times I see each person.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Person&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Totalnumviews&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;D&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then I use SQL to put the total of everything into a macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select sum(totalnumviews) into :totalviewstotal&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from megasetfinallast_&amp;amp;&amp;amp;K;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data schedule_eval_&amp;amp;&amp;amp;K;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total=&amp;amp;totalviewstotal;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;Right now this code gives me a daaset for each time the do loop (K) is run. But JUst want a dataset that each row is another iteration of the loop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;So row 1 will give me totalviewstotal for the first iteration, row 2 for the second iteration, etc. What do I need to do?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Mar 2013 21:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93705#M19750</guid>
      <dc:creator>Xamius32</dc:creator>
      <dc:date>2013-03-31T21:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93706#M19751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure I have the whole picture, but why not just create an empty table before starting your looping.&amp;nbsp; Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data totals ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; stop;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; length iteration total 8;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then each time in the loop insert a record into the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc sql ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; insert into totals&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select &amp;amp;K as iteration&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , &lt;SPAN style="color: #222222; font-size: 12.800000190734863px; font-style: inherit; background-color: #ffffff; line-height: 1.5em;"&gt;sum(totalnumviews) as total&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: 'courier new', courier; color: #222222;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from megasetfinallast_&amp;amp;K&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: 'courier new', courier; color: #222222;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: 'courier new', courier; color: #222222;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 02:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93706#M19751</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-01T02:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93707#M19752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm, it seems to only ouput the most recent iteration, and when it does it gives me the warning "INto clause that is not in the outermost query block will be ignored"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93707#M19752</guid>
      <dc:creator>Xamius32</dc:creator>
      <dc:date>2013-04-01T15:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93708#M19753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to show more of what you're doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're looping and want counts for each loop, typically you use a proc append at the end of the loop to stack your datasets for each loop. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93708#M19753</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-01T15:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93709#M19754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you have a typo that has caused SAS to confuse the INTO keyword that is part of the INSERT INTO syntax for adding records to a table with the INTO :macrovar syntax that is part of a SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no need to create macro variables, unless you need them for some other purpose.&amp;nbsp; It is much more straight forward just write directly to the data sets without first generating macro variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93709#M19754</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-01T15:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93710#M19755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the idea is that each row of this dataset (totals in this case) will be the results of each iteration of the do loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each iteration, the program is currently giving me a dataset that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="122.18181824684143" style="border: 1px solid #000000; width: 456.18181824684143px; height: 94.18181824684143px;" width="453.18181824684143"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Player&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Totalnumviews&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each time an iteration of the overall do loop is run, I will get a different table like the one above. So each time, I want a row to be outputed to the dataset that would say&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="73.18181824684143" style="border: 1px solid #000000; width: 553.1818182468414px; height: 46.18181824684143px;" width="551.1818182468414"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Iteration&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Total number of views&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;800&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;742&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And another row would just be added for each time the do loop is run. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93710#M19755</guid>
      <dc:creator>Xamius32</dc:creator>
      <dc:date>2013-04-01T15:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93711#M19756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm, i got rid of it going to macro variable and it got rid of the warning, but still only ouputs the latest iteration. So the first row now says iteration is 2, with a value for total.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93711#M19756</guid>
      <dc:creator>Xamius32</dc:creator>
      <dc:date>2013-04-01T15:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93712#M19757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it sounds like you placed after the end of the loop instead of inside the loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93712#M19757</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-01T15:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93713#M19758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nah, it is right before the loop ends.It works if I try to output a new dataset for each set of summary statistics for each iteration (meaning id have20 different datasets for 20 iterations). probably something im missing though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93713#M19758</guid>
      <dc:creator>Xamius32</dc:creator>
      <dc:date>2013-04-01T15:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93714#M19759</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;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;At the end of the loop you can add something like the following, Proc append doesn't require a table to be created originally. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;Assuming you have K as your loop, why do you have double ampersand in the sql query?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select sum(totalnumviews) into :totalviewstotal&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from megasetfinallast_&amp;amp;&amp;amp;K;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;&amp;nbsp; quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;data temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;iteration=&amp;amp;k.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;totalviewstotal=&amp;amp;totaviewstotal;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 12.800000190734863px; font-family: arial, sans-serif; color: #222222;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc append base=want data=temp;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&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;*Clean up tables for space maintenance and prevent errors;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sql;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;drop table temp;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;*End your loop;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%end;&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;*end of macro;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%mend;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93714#M19759</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-01T15:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93715#M19760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure you are not blowing away the summary table inside the loop.&lt;/P&gt;&lt;P&gt;So your code flow should look like:&lt;/P&gt;&lt;P&gt;&amp;lt;Initialize summary table &amp;gt;&lt;/P&gt;&lt;P&gt;do ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;calculate new numbers&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;append new record to summary table&amp;gt;&lt;/P&gt;&lt;P&gt;end..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do something with the summary table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 15:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93715#M19760</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-01T15:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting macro elements for each iteration of a do loop to a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93716#M19761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this seems to be working. Thanks a bunch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 16:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-macro-elements-for-each-iteration-of-a-do-loop-to-a/m-p/93716#M19761</guid>
      <dc:creator>Xamius32</dc:creator>
      <dc:date>2013-04-01T16:12:45Z</dc:date>
    </item>
  </channel>
</rss>

