<?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 and proc report - Need to create a sheet even if the input dataset is empty in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-and-proc-report-Need-to-create-a-sheet-even-if-the/m-p/533562#M22344</link>
    <description>&lt;P&gt;Sorry, again, i have not found a way to add an empty sheet.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Feb 2019 12:20:51 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-02-07T12:20:51Z</dc:date>
    <item>
      <title>ODS excel and proc report - Need to create a sheet even if the input dataset is empty</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-and-proc-report-Need-to-create-a-sheet-even-if-the/m-p/533554#M22342</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have scenario where I need to export multiple datasets to&amp;nbsp; a Excelsheet into different tabs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: I have three datasets A,B,C and i want to export into an excel workbook "Output" under sheets x,y,z correspondingly,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A ---&amp;gt; X&lt;/P&gt;&lt;P&gt;B ---&amp;gt; Y&lt;/P&gt;&lt;P&gt;C ---&amp;gt; Z&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro Export(ouput1=,input1=,ouput2=,input2=,ouput3=,input3=);&lt;BR /&gt;ods excel file="/External/Output.xlsx"&lt;BR /&gt;options (sheet_name = "&amp;amp;input1.") style=statistical;&lt;BR /&gt;Proc report data= &amp;amp;output1.&lt;BR /&gt;style(header)=[background=LightGray];&lt;BR /&gt;columns col1 col2 col3;&lt;BR /&gt;define col1 /display ;&lt;BR /&gt;define col2 /display ;&lt;BR /&gt;define col3 /display ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods excel options(sheet_name = "&amp;amp;input2");&lt;BR /&gt;proc report data= output2.&lt;BR /&gt;style(header)=[background=LightGray];&lt;BR /&gt;columns col1 col2 col3;&lt;BR /&gt;define col1 /display ;&lt;BR /&gt;define col2 /display ;&lt;BR /&gt;define col3 /display ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;ods excel options(sheet_name = "&amp;amp;input3");&lt;BR /&gt;proc report data= output3.&lt;BR /&gt;style(header)=[background=LightGray];&lt;BR /&gt;columns col1 col2 col3;&lt;BR /&gt;define col1 /display ;&lt;BR /&gt;define col2 /display ;&lt;BR /&gt;define col3 /display ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend Export;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%Export(ouput1=A, input1=X, ouput2=B, input2=Y, ouput=C, input3=Z);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Out of my 3 input datasets, lets take B is an empty dataset but I wanted that corresponding sheet Y to be created as a blank one in my output excel file. Because the dataset B can be empty or have values based on that particular run on a given day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suggestions are highly appreciated!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Vigneswar&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 10:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-and-proc-report-Need-to-create-a-sheet-even-if-the/m-p/533554#M22342</guid>
      <dc:creator>Vigneswar</dc:creator>
      <dc:date>2019-02-07T10:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: ODS excel and proc report - Need to create a sheet even if the input dataset is empty</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-and-proc-report-Need-to-create-a-sheet-even-if-the/m-p/533556#M22343</link>
      <description>&lt;P&gt;Why have you written a macro? Seems to be not necessary to solve the problem. I added te option sheet_interval and i got an excel file with two sheets as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="output.xlsx" 
      options(sheet_interval="proc");

   ods excel options(sheet_name="Class");
   proc print data=sashelp.class;
   run;

   ods excel options(sheet_name="Cars");
   proc print data=sashelp.cars;
   run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5" color="#3366FF"&gt;Sorry, i should have read the whole post &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3" color="#3366FF"&gt;&lt;FONT color="#000000"&gt;The code, of course, does not solve your problem ...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 11:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-and-proc-report-Need-to-create-a-sheet-even-if-the/m-p/533556#M22343</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-02-07T11:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: ODS excel and proc report - Need to create a sheet even if the input dataset is empty</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-and-proc-report-Need-to-create-a-sheet-even-if-the/m-p/533562#M22344</link>
      <description>&lt;P&gt;Sorry, again, i have not found a way to add an empty sheet.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 12:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-and-proc-report-Need-to-create-a-sheet-even-if-the/m-p/533562#M22344</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-02-07T12:20:51Z</dc:date>
    </item>
  </channel>
</rss>

