<?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 multiple datasets to Excel workbook in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571244#M161140</link>
    <description>You can use ODS EXCEL. &lt;BR /&gt;If you need more details, please provide more details about your problem. Vague questions will get vague answers.</description>
    <pubDate>Thu, 04 Jul 2019 15:02:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-07-04T15:02:53Z</dc:date>
    <item>
      <title>Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571226#M161131</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;how can you export 50 data sets into single excel workbook with different sheets.&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;Advance Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571226#M161131</guid>
      <dc:creator>nayab_shaik</dc:creator>
      <dc:date>2019-07-04T12:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571227#M161132</link>
      <description>&lt;P&gt;Are the data sets in the same library? And how do you determine the names of the data sets?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571227#M161132</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-07-04T12:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571230#M161133</link>
      <description>&lt;P&gt;yes&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571230#M161133</guid>
      <dc:creator>nayab_shaik</dc:creator>
      <dc:date>2019-07-04T12:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571231#M161134</link>
      <description>&lt;P&gt;There are a few examples to get you going here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/td-p/426861" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/How-do-i-Export-Multiple-Sas-Datasets-into-ms-excel-workbook/td-p/426861&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571231#M161134</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-07-04T12:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571236#M161137</link>
      <description>&lt;P&gt;Please use more descriptive subject lines in the future. "sas" is NOT descriptive.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571236#M161137</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-04T12:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571244#M161140</link>
      <description>You can use ODS EXCEL. &lt;BR /&gt;If you need more details, please provide more details about your problem. Vague questions will get vague answers.</description>
      <pubDate>Thu, 04 Jul 2019 15:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571244#M161140</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-04T15:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571254#M161142</link>
      <description>&lt;P&gt;You can try the below. Just change the OUTFILE= with the full path of the file (in which you want all the results to go). Please note this macro &lt;STRONG&gt;may not&lt;/STRONG&gt; work if you have more than 255 sheets to be exported. LIBNAME is the library/folder where all your sas datasets are there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO ExportAllDatasetsToExcel(LIBNAME, Extension="XLS");

	PROC SQL NOPRINT;
	CREATE TABLE columns as
	SELECT DISTINCT(memname) AS table_name FORMAT=$30.
	FROM dictionary.columns
	WHERE libname = &amp;amp;LIBNAME
	;
	quit;
	
	PROC SQL NOPRINT;
		SELECT COUNT(*) AS NumObs INTO :NumObs FROM columns;
	RUN;

	%DO I=1 %TO &amp;amp;NumObs;
		DATA _NULL_ ;
			SET Columns (FIRSTOBS=&amp;amp;I OBS=&amp;amp;I);
			CALL SYMPUT('TableName',TRIM(table_name));
		RUN;
		%PUT "&amp;amp;TableName";
		PROC EXPORT DATA=&amp;amp;LIBNAME..&amp;amp;TableName DBMS=XLSX OUTFILE="FullPathOfTheFileHere.xlsx";
		SHEET="&amp;amp;TableName";
		RUN;
	%END;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please let me know if this worked for you. I am just curious.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 15:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571254#M161142</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-07-04T15:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571313#M161162</link>
      <description>&lt;P&gt;Shouldn't this work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;libname XL xlsx "%sysfunc(pathname(WORK))\T.xlsx";&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc copy inlib=WORK outlib=XL mt=data;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 05:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571313#M161162</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-07-05T05:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571318#M161165</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Shouldn't this work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;libname XL xlsx "%sysfunc(pathname(WORK))\T.xlsx";&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc copy inlib=WORK outlib=XL mt=data;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Works perfect, with one minor glitch:&lt;/P&gt;
&lt;PRE&gt;WARNING: Engine XLSX does not support SORTEDBY operations.  SORTEDBY information cannot be copied.&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jul 2019 06:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571318#M161165</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-07-05T06:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571324#M161166</link>
      <description>That makes sense of course. No metadata in Excel.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Jul 2019 07:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571324#M161166</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-07-05T07:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571392#M161173</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;Works very nicely. Your code is simple and elegant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read earlier but I forgot&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;advice (his Maxim 11 of 52 ... that a Macro is not needed) and the result is a negative control of an experiment (wherein the positive control being someone pursuing reuse of existing code and elegance).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lesson: Use BASE SAS first. So much is already there. &lt;STRONG&gt;Perhaps many times,&amp;nbsp;&lt;/STRONG&gt;one can spare reinventing the wheel.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 13:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571392#M161173</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-07-05T13:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export multiple datasets to Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571451#M161195</link>
      <description>&lt;P&gt;Thanku you&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 17:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-multiple-datasets-to-Excel-workbook/m-p/571451#M161195</guid>
      <dc:creator>nayab_shaik</dc:creator>
      <dc:date>2019-07-05T17:01:12Z</dc:date>
    </item>
  </channel>
</rss>

