<?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: export 2 datasets data to only one Excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864403#M341368</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/440799"&gt;@Gab12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hello thank you for your answer The two databases have different structure and data I want to export them in the two ranges indicated in my question on the same sheet the problem is that if we specify the ranges in PROC EXPORT it crase the other data that already exists in the sheet&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is not how you export data to XLSX files.&amp;nbsp; Write the data to their own sheets.&amp;nbsp; If you want then copy it into specific places on another sheet to make a "pretty" report then use Excel's internal functionality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or just create the whole report using SAS and skip the Excel programming completely.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Mar 2023 19:38:32 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-03-15T19:38:32Z</dc:date>
    <item>
      <title>export 2 datasets data to only one Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864351#M341353</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;I have two datasets say DS_A&amp;nbsp; and DS_B .&lt;/P&gt;&lt;P&gt;Both datasets contains&amp;nbsp;&lt;SPAN&gt;3 variables &amp;amp; 10 observations each.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I wish to export these datasets data to only one Excel file ( File_name : Sample.XLS, SheetName: Sheet1 )&lt;/P&gt;&lt;P&gt;I need&amp;nbsp;to Export DS_A data to Sheet1 from A1:C10&amp;nbsp; cells and DS_B data to Same Sheet1 from A15:C25 cells .&lt;/P&gt;&lt;P&gt;thank you for proposing an efficient solution that would allow me to export these two tables without overwriting the first export&lt;BR /&gt;Thank you in advance for your help&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 15:49:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864351#M341353</guid>
      <dc:creator>Gab12</dc:creator>
      <dc:date>2023-03-15T15:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: export 2 datasets data to only one Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864382#M341364</link>
      <description>&lt;P&gt;Why? Why would use make an XLS file in this day and age?&amp;nbsp; WHy would you put data from two different sources into one sheet of a spreadsheet?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the two datasets as one then just combine them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname out xlsx 'sample.xlsx';
data out.sheet1;
  set ds_a ds_b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to produce a report you can use the SHEET_INTERVAL=NONE option of ODS EXCEL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file='sample.xlsx'
  option( sheet_interval=none sheet_name='Sheet1')
;

proc print data=ds_a noobs;
run;
proc print data=ds_b noobs;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Mar 2023 17:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864382#M341364</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-15T17:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: export 2 datasets data to only one Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864399#M341367</link>
      <description>Hello thank you for your answer The two databases have different structure and data I want to export them in the two ranges indicated in my question on the same sheet the problem is that if we specify the ranges in PROC EXPORT it crase the other data that already exists in the sheet</description>
      <pubDate>Wed, 15 Mar 2023 19:02:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864399#M341367</guid>
      <dc:creator>Gab12</dc:creator>
      <dc:date>2023-03-15T19:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: export 2 datasets data to only one Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864403#M341368</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/440799"&gt;@Gab12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hello thank you for your answer The two databases have different structure and data I want to export them in the two ranges indicated in my question on the same sheet the problem is that if we specify the ranges in PROC EXPORT it crase the other data that already exists in the sheet&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is not how you export data to XLSX files.&amp;nbsp; Write the data to their own sheets.&amp;nbsp; If you want then copy it into specific places on another sheet to make a "pretty" report then use Excel's internal functionality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or just create the whole report using SAS and skip the Excel programming completely.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 19:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-2-datasets-data-to-only-one-Excel-file/m-p/864403#M341368</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-15T19:38:32Z</dc:date>
    </item>
  </channel>
</rss>

