<?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: How to export multiple SAS Datasets into the same sheet in Excel workbook? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602483#M174455</link>
    <description>This isn't a great standalone presentation but the code is in here that demonstrates the steps needed. The DDE is for running custom macros and if I was doing it today I wouldn't necessarily do it that way. &lt;BR /&gt;</description>
    <pubDate>Thu, 07 Nov 2019 16:45:54 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-11-07T16:45:54Z</dc:date>
    <item>
      <title>How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602474#M174450</link>
      <description>&lt;P&gt;I have multiple sas small datasets and need to export the same sheet in Excel workbook. I defined different range cells for each data set in the same sheet. Anyone know how to do this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 16:26:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602474#M174450</guid>
      <dc:creator>QLi</dc:creator>
      <dc:date>2019-11-07T16:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602475#M174451</link>
      <description>&lt;P&gt;One way (but you have no control over the exact positioning of the tables)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="myexcelfile.xlsx" options(sheet_interval='NONE');
proc print data=dataset1;
run;
proc print data=dataset2;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Nov 2019 16:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602475#M174451</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-07T16:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602480#M174452</link>
      <description>Thanks for your quick response. &lt;BR /&gt;ODS is one way. However its generated file size so big. I need to export  sas datasets  in one template sheet which has specific position for each data set.   Thanks</description>
      <pubDate>Thu, 07 Nov 2019 16:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602480#M174452</guid>
      <dc:creator>QLi</dc:creator>
      <dc:date>2019-11-07T16:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602481#M174453</link>
      <description>&lt;P&gt;Not sure that this is the "best" approach by any means but I've had to setup a powershell script to re-organize the data before (mainly copy-pasting into macro-enabled workbook). If all else fails you can look into this approach.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 16:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602481#M174453</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2019-11-07T16:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602482#M174454</link>
      <description>From ODS EXCEL? I recall that issue with ODS TAGSETS but not ODS EXCEL. &lt;BR /&gt;&lt;BR /&gt;What version of SAS do you have exactly? DDE is one option as is the custom macro written by some users here or you can try exporting to a named range. &lt;BR /&gt;&lt;BR /&gt;First copy your template so you don't mess it up, then assign a libname to the file and see if the named ranges show up as tables - they should. You may want them to have some data to examine it. &lt;BR /&gt;If they are there then you can use a data step or proc sql to replace the tables such as:&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;drop table mywb.named_range1;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;data mywb.named_range1;&lt;BR /&gt;set have1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Note that when you do export data, the formats and such will likely disappear and variable names are always exported so what I usually do is export my data to a sheet and then link it to the range I want to make my life a lot easier.</description>
      <pubDate>Thu, 07 Nov 2019 16:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602482#M174454</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-07T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602483#M174455</link>
      <description>This isn't a great standalone presentation but the code is in here that demonstrates the steps needed. The DDE is for running custom macros and if I was doing it today I wouldn't necessarily do it that way. &lt;BR /&gt;</description>
      <pubDate>Thu, 07 Nov 2019 16:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602483#M174455</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-07T16:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602522#M174462</link>
      <description>I am using EG7.1, which should with SAS9.4.  I wrote the following codes. it can not export the same sheet, each data set automatically generated different sheet.&lt;BR /&gt;&lt;BR /&gt;options noxwait xsync; &lt;BR /&gt;x copy "temp_v0.xlsx"  &amp;amp;excel_out; &lt;BR /&gt;libname xls excel &amp;amp;excel_out  ; run;&lt;BR /&gt;&lt;BR /&gt;proc datasets lib = xls nolist; &lt;BR /&gt;delete &lt;BR /&gt; Summary Rejected1 Rejected2 Point_O_New Point_overall_Existed ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;data xls.Summary; set RDP_Sum_t ; run;&lt;BR /&gt;data xls.Rejected1; set RDP_Sum_Reject  ;run; &lt;BR /&gt;data xls.Rejected2; set RDP_Sum_Reject2 ; run; &lt;BR /&gt;data xls.Point_overall_Existed ; set Point_1(where=( EXISTINGCUSTOMER='true')); run;&lt;BR /&gt;&lt;BR /&gt;libname xls clear;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I will try your approach. Thank you very much</description>
      <pubDate>Thu, 07 Nov 2019 17:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602522#M174462</guid>
      <dc:creator>QLi</dc:creator>
      <dc:date>2019-11-07T17:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602533#M174465</link>
      <description>libname xls?&lt;BR /&gt;DId you try PCFILES or ODBC?</description>
      <pubDate>Thu, 07 Nov 2019 18:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602533#M174465</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-07T18:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602579#M174473</link>
      <description>&lt;P&gt;How exactly are you going dump multiple datasets into the same worksheet?&amp;nbsp; If the columns are not the same it will look terrible.&amp;nbsp; If they are the same then why not just combine them into one dataset and dump that?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602579#M174473</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-07T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602725#M174534</link>
      <description>&lt;P&gt;I remember there is an option :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;excel&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;file&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"myexcelfile.xlsx"&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;options&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;sheet_interval&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'NONE' start_at='2,5'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could search it at&amp;nbsp; &amp;nbsp;blogs.sas.com&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 13:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602725#M174534</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-11-08T13:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to export multiple SAS Datasets into the same sheet in Excel workbook?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602932#M174625</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18299"&gt;@QLi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I am using EG7.1, which should with SAS9.4. I wrote the following codes. it can not export the same sheet, each data set automatically generated different sheet.&lt;BR /&gt;&lt;BR /&gt;options noxwait xsync; &lt;BR /&gt;x copy "temp_v0.xlsx" &amp;amp;excel_out; &lt;BR /&gt;libname xls excel &amp;amp;excel_out ; run;&lt;BR /&gt;&lt;BR /&gt;proc datasets lib = xls nolist; &lt;BR /&gt;delete &lt;BR /&gt;Summary Rejected1 Rejected2 Point_O_New Point_overall_Existed ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;data xls.Summary; set RDP_Sum_t ; run;&lt;BR /&gt;data xls.Rejected1; set RDP_Sum_Reject ;run; &lt;BR /&gt;data xls.Rejected2; set RDP_Sum_Reject2 ; run; &lt;BR /&gt;data xls.Point_overall_Existed ; set Point_1(where=( EXISTINGCUSTOMER='true')); run;&lt;BR /&gt;&lt;BR /&gt;libname xls clear;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I will try your approach. Thank you very much&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is not actually "exporting" it is "writing", at least in my mind. Excel is a poor data interchange medium and since data steps write data then SAS has, rightly in my mind, forced writing data sets to spread sheets as separate pages so that you cannot in any way, shape, or form have inconsistent data in a single column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nothing like reading the first 600 rows of data as "dates" and then discover at row 602 the data is now "names", phone numbers or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if the variables are all of the same type and name then combine the SAS data sets and use a single process to write the data.&lt;/P&gt;
&lt;P&gt;You could even add a variable as those sets are combined to have information about the data source on each and every record. Your attempted approach does not do that. So even if you succeeded how do you know where the Reject data starts?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 23:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-multiple-SAS-Datasets-into-the-same-sheet-in-Excel/m-p/602932#M174625</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-08T23:35:33Z</dc:date>
    </item>
  </channel>
</rss>

