<?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 export to excel with special needs in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402607#M19556</link>
    <description>&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;I have 5 SAS tables.&lt;/P&gt;&lt;P&gt;I want to export them to one excel file as following:&lt;/P&gt;&lt;P&gt;Tables Pop1 ,Pop2,Pop3 &amp;nbsp;to have in sheet1 (side by side to each other)&lt;/P&gt;&lt;P&gt;Tables Ref1 &amp;nbsp;,Ref2&amp;nbsp;to have in sheet2 (side by side to each other)&lt;/P&gt;&lt;P&gt;Please mention that I want all tables to be in one excel file (with two sheets as I explained before)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data pop1;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data pop2;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data pop3;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data Ref1;&lt;BR /&gt;input w;&lt;BR /&gt;cards;&lt;BR /&gt;10&lt;BR /&gt;20&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Data Ref2;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;30&lt;BR /&gt;40&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro mmacro1;&lt;BR /&gt;%do k=1 %to 3;&lt;BR /&gt;Title "pop&amp;amp;k.";&lt;BR /&gt;proc print data=pop&amp;amp;k. noobs;&lt;BR /&gt;footnote;&lt;BR /&gt;Run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%mmacro1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro mmacro2;&lt;BR /&gt;%do k=1 %to 2;&lt;BR /&gt;Title "Ref&amp;amp;k.";&lt;BR /&gt;proc print data=Ref&amp;amp;k. noobs;&lt;BR /&gt;footnote;&lt;BR /&gt;Run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%mmacro2;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 05:42:52 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2017-10-10T05:42:52Z</dc:date>
    <item>
      <title>export to excel with special needs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402607#M19556</link>
      <description>&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;I have 5 SAS tables.&lt;/P&gt;&lt;P&gt;I want to export them to one excel file as following:&lt;/P&gt;&lt;P&gt;Tables Pop1 ,Pop2,Pop3 &amp;nbsp;to have in sheet1 (side by side to each other)&lt;/P&gt;&lt;P&gt;Tables Ref1 &amp;nbsp;,Ref2&amp;nbsp;to have in sheet2 (side by side to each other)&lt;/P&gt;&lt;P&gt;Please mention that I want all tables to be in one excel file (with two sheets as I explained before)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data pop1;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data pop2;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data pop3;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data Ref1;&lt;BR /&gt;input w;&lt;BR /&gt;cards;&lt;BR /&gt;10&lt;BR /&gt;20&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Data Ref2;&lt;BR /&gt;input x;&lt;BR /&gt;cards;&lt;BR /&gt;30&lt;BR /&gt;40&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro mmacro1;&lt;BR /&gt;%do k=1 %to 3;&lt;BR /&gt;Title "pop&amp;amp;k.";&lt;BR /&gt;proc print data=pop&amp;amp;k. noobs;&lt;BR /&gt;footnote;&lt;BR /&gt;Run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%mmacro1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro mmacro2;&lt;BR /&gt;%do k=1 %to 2;&lt;BR /&gt;Title "Ref&amp;amp;k.";&lt;BR /&gt;proc print data=Ref&amp;amp;k. noobs;&lt;BR /&gt;footnote;&lt;BR /&gt;Run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%mmacro2;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 05:42:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402607#M19556</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2017-10-10T05:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel with special needs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402609#M19557</link>
      <description>&lt;P&gt;If I run this code I get each table in a different sheet!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp&lt;BR /&gt;file="/usr/local/SAS/MidulOld/UserDir/Ron.xls"&lt;BR /&gt;options(sheet_name='Pop') style=sasweb;&lt;BR /&gt;%macro mmacro1;&lt;BR /&gt;%do k=1 %to 3;&lt;BR /&gt;Title "pop&amp;amp;k.";&lt;BR /&gt;proc print data=pop&amp;amp;k. noobs;&lt;BR /&gt;footnote;&lt;BR /&gt;Run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%mmacro1;&lt;BR /&gt;&lt;BR /&gt;ods tagsets.excelxp options(sheet_name='Ref');&lt;BR /&gt;%macro mmacro2;&lt;BR /&gt;%do k=1 %to 2;&lt;BR /&gt;Title "Ref&amp;amp;k.";&lt;BR /&gt;proc print data=Ref&amp;amp;k. noobs;&lt;BR /&gt;footnote;&lt;BR /&gt;Run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%mmacro2;&lt;BR /&gt;ods _all_ close;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 05:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402609#M19557</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2017-10-10T05:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel with special needs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402615#M19558</link>
      <description>&lt;P&gt;You might be able to achieve something like this with using named ranges, but I'd rather create a dataset for each sheet and then copy it into the Excel file with libname excel, or use tagsets.excelp to print each dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a simple datastep merge to put the values side-by-side (you can't use the same column name, of course, but you can use labels for the names):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sheet1
merge
  pop1
  pop2 (rename=(x=x2))
  pop3 (rename=(x=x3))
;
label
  x = 'x'
  x2 = 'x'
  x3 = 'x'
;
run;

data sheet2;
merge
  ref1
  ref2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then, in your ods output, just do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods tagsets.excelxp
file="/usr/local/SAS/MidulOld/UserDir/Ron.xls"
options(sheet_name='Pop') style=sasweb;

proc print data=sheet1 label noobs;
run;

ods tagsets.excelxp options(sheet_name='Ref');

proc print data=sheet2 noobs;
run;

ods tagsets.excelxp close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 06:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402615#M19558</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-10T06:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel with special needs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402654#M19564</link>
      <description>&lt;P&gt;Thank you so much and it was a good answer.&lt;/P&gt;&lt;P&gt;But....I want to have separate tables and add also titles &amp;nbsp;for each table.&lt;/P&gt;&lt;P&gt;So the merge idea is not good .&lt;/P&gt;&lt;P&gt;I want to have a panel of separate tables in same sheet (3 tables in sheet1 and 2 tables in sheet2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 10:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/export-to-excel-with-special-needs/m-p/402654#M19564</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2017-10-10T10:31:42Z</dc:date>
    </item>
  </channel>
</rss>

