<?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: ODS EXCEL multiple sheets for each iteration in a macro in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-multiple-sheets-for-each-iteration-in-a-macro/m-p/471779#M21113</link>
    <description>&lt;P&gt;Try the solution in this link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-amp-multiple-sheets/m-p/261953/highlight/true#M15551" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-amp-multiple-sheets/m-p/261953/highlight/true#M15551&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is a bug and&amp;nbsp;you have to create a dummy table code to make this work and put each output on it's own tab&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 16:23:56 GMT</pubDate>
    <dc:creator>HN2001</dc:creator>
    <dc:date>2018-06-20T16:23:56Z</dc:date>
    <item>
      <title>ODS EXCEL multiple sheets for each iteration in a macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-multiple-sheets-for-each-iteration-in-a-macro/m-p/471768#M21112</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a macro loop to execute a proc tabulate multiple times for one variable and runs again multiple times for another variable.&lt;/P&gt;&lt;P&gt;I want to output each variable's multiple tabulate runs on separate sheets. I have tried using a different sheet name however its not working and I am getting all the proc tabulate outputs in one single sheet.&lt;/P&gt;&lt;P&gt;example code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO Tabulate_rolls;&lt;BR /&gt;%local j i count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%do j = 1 %to %sysfunc(countw(&amp;amp;DateList)); /*Datelist = List of months*/&lt;BR /&gt;&amp;nbsp; &amp;nbsp; %LET Month = %Scan(&amp;amp;DateList, &amp;amp;j);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ODS EXCEL OPTIONS(sheet_name = "&amp;amp;Month.");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; %do i=1 %TO &amp;amp;RollforMonths;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %let CurrMonth=%scan(&amp;amp;ARBList, &amp;amp;j );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%let NextMonth=%scan(&amp;amp;ARBlist, %sysfunc(INTCK(month, %sysevalf('01JAN2011'd), %sysevalf("&amp;amp;NewBizMonth."d) ))+1+&amp;amp;i );&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PROC Tabulate DATA=data1 MISSING;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CLASS &amp;amp;CurrMonth &amp;amp;NextMonth ;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; TABLE &amp;amp;CurrMonth="", &amp;amp;NextMonth*(ROWPCTN=""*f=Percent_pict.); &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; RUN;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS EXCEL FILE="C:\temp\New Microsoft Excel Worksheet.xlsx"&lt;BR /&gt;OPTIONS(sheet_interval = "none");&lt;BR /&gt;/*Run the New business flow*/&lt;BR /&gt;%Tabulate_rolls;&lt;BR /&gt;ODS EXCEL CLOSE;&lt;BR /&gt;%PUT _USER_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am expecting that for each&amp;nbsp;iteration of the first Do loop (with j = 1 to %sysfunc....) the ODS EXCEL OPTIONS will create another sheet with the name from &amp;amp;Month and write all the iterations of the internal do loop (with i = 1 to rollformonths)&amp;nbsp;proc tabulate to the new sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it doesnt work and it writes all the output in one single sheet . I have tried playing with the sheet_interval option but it primarily creates one sheet for every run of proc tabulate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rohit&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-multiple-sheets-for-each-iteration-in-a-macro/m-p/471768#M21112</guid>
      <dc:creator>Rohit_R</dc:creator>
      <dc:date>2018-06-20T16:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL multiple sheets for each iteration in a macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-multiple-sheets-for-each-iteration-in-a-macro/m-p/471779#M21113</link>
      <description>&lt;P&gt;Try the solution in this link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-amp-multiple-sheets/m-p/261953/highlight/true#M15551" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-amp-multiple-sheets/m-p/261953/highlight/true#M15551&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is a bug and&amp;nbsp;you have to create a dummy table code to make this work and put each output on it's own tab&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-multiple-sheets-for-each-iteration-in-a-macro/m-p/471779#M21113</guid>
      <dc:creator>HN2001</dc:creator>
      <dc:date>2018-06-20T16:23:56Z</dc:date>
    </item>
  </channel>
</rss>

