<?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: multiple datasets into one sheet in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/multiple-datasets-into-one-sheet/m-p/313865#M17385</link>
    <description>&lt;P&gt;Two details to add to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4877"&gt;@Haikuo﻿&lt;/a&gt;'s suggestion&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) if your dataset names have a common prefix, you can use a dataset list in the set statement: SET TABLE: ;&lt;/P&gt;
&lt;P&gt;2) If you want to remember which dataset the rows came from, you can add a third field to the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA OUT.want;
length from $32;
SET table: INDSNAME=DS;
from = scan(DS, 2, ".");
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Nov 2016 19:15:55 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-11-23T19:15:55Z</dc:date>
    <item>
      <title>multiple datasets into one sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/multiple-datasets-into-one-sheet/m-p/313842#M17383</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;I have 800 datasets and i want to export all the datasets into one sheet and not multiple sheet and each dataset has two varaibles&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dataset A&lt;/P&gt;
&lt;P&gt;count_id&amp;nbsp; rate&lt;/P&gt;
&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.12&lt;/P&gt;
&lt;P&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.13&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dataset B&lt;/P&gt;
&lt;P&gt;count_id rate&lt;/P&gt;
&lt;P&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11&lt;/P&gt;
&lt;P&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.22&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i want both these datasets to write to one excel sheet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone pls help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 16:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/multiple-datasets-into-one-sheet/m-p/313842#M17383</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2016-11-23T16:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: multiple datasets into one sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/multiple-datasets-into-one-sheet/m-p/313848#M17384</link>
      <description>&lt;P&gt;Am I the only one at work today &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://communities.sas.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well you can two approaches,&lt;/P&gt;
&lt;P&gt;1. &amp;nbsp;union/stack/append your sas tables first, if you don't like the intermedian table, you can opt for sas views, then output to Excel.&lt;/P&gt;
&lt;P&gt;2. Do it on the fly, if you have SAS/ACCESS to pc files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My gut tells me that you are asking for the #2, so here it goes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
LIBNAME OUT XLSX "/your output folder/want.XLSX";

DATA OUT.want;
SET table1 table2 .....;
RUN;


LIBNAME OUT CLEAR ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have 800ish table, then you may want to leverage your meta data, meaning throwing the table names into a macro variable to avoid typing.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 17:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/multiple-datasets-into-one-sheet/m-p/313848#M17384</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-11-23T17:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: multiple datasets into one sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/multiple-datasets-into-one-sheet/m-p/313865#M17385</link>
      <description>&lt;P&gt;Two details to add to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4877"&gt;@Haikuo﻿&lt;/a&gt;'s suggestion&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) if your dataset names have a common prefix, you can use a dataset list in the set statement: SET TABLE: ;&lt;/P&gt;
&lt;P&gt;2) If you want to remember which dataset the rows came from, you can add a third field to the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA OUT.want;
length from $32;
SET table: INDSNAME=DS;
from = scan(DS, 2, ".");
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 19:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/multiple-datasets-into-one-sheet/m-p/313865#M17385</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-11-23T19:15:55Z</dc:date>
    </item>
  </channel>
</rss>

