<?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: Create multiple tables in the same sheet next to each other using ODS Destination for Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913916#M360168</link>
    <description>&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/msoffice2k/index.html" target="_blank" rel="noopener"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/msoffice2k/index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;After you got this XML file, you could convert it into a native Excel file by this macro.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/43/496.html" target="_blank" rel="noopener"&gt;43496 - Convert files created using an ODS destination to native Microsoft Excel files (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxsync noxwait;
%include "c:\temp\a\msoffice2k_x.sas";


ods noresults;
ods _all_ close;
ods tagsets.msoffice2k_x  file="c:\temp\a\panels.xls"
      options(panelcols="3") style=normal;

  proc print data=sashelp.prdsale(obs=10);
  var actual predict country region;
  where country="CANADA";
  title "Canada Sales";
  run;

  proc print data=sashelp.prdsale(obs=10);
  var actual predict country region;
  where country="U.S.A.";
  title "USA Sales";
  run;

  proc print data=sashelp.prdsale(obs=10);
  var actual predict country region;
  where country="GERMANY";
  title "Germany Sales";
  run;

  ods tagsets.msoffice2k_x  options(panelcols="2") ;

 proc print data=sashelp.prdsale(obs=20);
 where region="EAST";
 title "East Sales";
 run;

 proc print data=sashelp.prdsale(obs=20);
 where region="WEST";
 title "West Sales";
 run;


 ods tagsets.msoffice2k_x close;


 %include "c:\temp\a\convert.sas";
 %convert_files(default=c:\temp\a ,ext=xls);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_2-1706772898677.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93141i6432F99F1148B990/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_2-1706772898677.png" alt="Ksharp_2-1706772898677.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1706773894961.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93142i008707E2FEF545B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1706773894961.png" alt="Ksharp_0-1706773894961.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2024 07:51:43 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-02-01T07:51:43Z</dc:date>
    <item>
      <title>Create multiple tables in the same sheet next to each other using ODS Destination for Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913743#M360118</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to ask for your help on the below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to send multiple outputs on the same sheet next to each other using the ODS destination for excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know how to do it vertically using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sheet_interval="NONE"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I have not been able to figure how to put the outputs next to each other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below a piece of code that displays the outputs vertically:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data productA;
input CODE $ Value;
datalines;
A 10
B 20
C 30
;
run;

data productB;
input CODE $ Value;
datalines;
D 110
E 220
F 330
;
run;

ODS EXCEL 
FILE = "&amp;amp;work_path/reports"
OPTIONS(sheet_name="PRODUCTS" 
		sheet_interval="NONE");

PROC REPORT DATA=productA;
RUN;

PROC REPORT DATA=productB;
RUN;

ODS EXCEL CLOSE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above piece of code returns:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Zatere_1-1706697259983.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93094i5A3CE749EE924A60/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Zatere_1-1706697259983.png" alt="Zatere_1-1706697259983.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to put the outputs next to each other instead please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 10:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913743#M360118</guid>
      <dc:creator>Zatere</dc:creator>
      <dc:date>2024-01-31T10:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple tables in the same sheet next to each other using ODS Destination for Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913753#M360124</link>
      <description>&lt;P&gt;ODS Excel does not offer that capability.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could join (merge) the data sets in SAS before writing to Excel, but then you would need different column names after the join (merge), such as CODE, VALUE, CODE1, VALUE1. Then when you write to Excel, there is no blank column between the two tables (unless you also include a blank column in your SAS code when you do the join)&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 11:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913753#M360124</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-01-31T11:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple tables in the same sheet next to each other using ODS Destination for Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913916#M360168</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/msoffice2k/index.html" target="_blank" rel="noopener"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/msoffice2k/index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;After you got this XML file, you could convert it into a native Excel file by this macro.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/43/496.html" target="_blank" rel="noopener"&gt;43496 - Convert files created using an ODS destination to native Microsoft Excel files (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxsync noxwait;
%include "c:\temp\a\msoffice2k_x.sas";


ods noresults;
ods _all_ close;
ods tagsets.msoffice2k_x  file="c:\temp\a\panels.xls"
      options(panelcols="3") style=normal;

  proc print data=sashelp.prdsale(obs=10);
  var actual predict country region;
  where country="CANADA";
  title "Canada Sales";
  run;

  proc print data=sashelp.prdsale(obs=10);
  var actual predict country region;
  where country="U.S.A.";
  title "USA Sales";
  run;

  proc print data=sashelp.prdsale(obs=10);
  var actual predict country region;
  where country="GERMANY";
  title "Germany Sales";
  run;

  ods tagsets.msoffice2k_x  options(panelcols="2") ;

 proc print data=sashelp.prdsale(obs=20);
 where region="EAST";
 title "East Sales";
 run;

 proc print data=sashelp.prdsale(obs=20);
 where region="WEST";
 title "West Sales";
 run;


 ods tagsets.msoffice2k_x close;


 %include "c:\temp\a\convert.sas";
 %convert_files(default=c:\temp\a ,ext=xls);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_2-1706772898677.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93141i6432F99F1148B990/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_2-1706772898677.png" alt="Ksharp_2-1706772898677.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1706773894961.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93142i008707E2FEF545B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1706773894961.png" alt="Ksharp_0-1706773894961.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 07:51:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913916#M360168</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-02-01T07:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple tables in the same sheet next to each other using ODS Destination for Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913918#M360170</link>
      <description>&lt;P&gt;Maybe Report Writing Interface could be used to place tables next to each other. I never had to do this, so i can't provide any code.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 06:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-tables-in-the-same-sheet-next-to-each-other/m-p/913918#M360170</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2024-02-01T06:44:42Z</dc:date>
    </item>
  </channel>
</rss>

