<?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 all the datasets from work library in excel format with datasets name as excel sheet names in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Export-all-the-datasets-from-work-library-in-excel-format-with/m-p/582861#M13884</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to export all the tables from work library in excel format with dataset names as sheet names:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let path = "C:\Users\Data";



PROC EXPORT DATA= Data1 OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET='Data1';
RUN;


PROC EXPORT DATA= SecondData OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET='SecondData';
RUN;



PROC EXPORT DATA= Data3 OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET=''Data3";
RUN;

&lt;/PRE&gt;&lt;P&gt;As can be seen, I have to write the same code multiple times to export the data in the same excel file with dataset name as sheet names. Is there any way, I can write one Proc export and just export all the datasets available in the work library in the excel format with dataset names as sheet names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandan Mishra&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2019 15:25:47 GMT</pubDate>
    <dc:creator>chandan_mishra</dc:creator>
    <dc:date>2019-08-21T15:25:47Z</dc:date>
    <item>
      <title>Export all the datasets from work library in excel format with datasets name as excel sheet names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-all-the-datasets-from-work-library-in-excel-format-with/m-p/582861#M13884</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to export all the tables from work library in excel format with dataset names as sheet names:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let path = "C:\Users\Data";



PROC EXPORT DATA= Data1 OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET='Data1';
RUN;


PROC EXPORT DATA= SecondData OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET='SecondData';
RUN;



PROC EXPORT DATA= Data3 OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET=''Data3";
RUN;

&lt;/PRE&gt;&lt;P&gt;As can be seen, I have to write the same code multiple times to export the data in the same excel file with dataset name as sheet names. Is there any way, I can write one Proc export and just export all the datasets available in the work library in the excel format with dataset names as sheet names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandan Mishra&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 15:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-all-the-datasets-from-work-library-in-excel-format-with/m-p/582861#M13884</guid>
      <dc:creator>chandan_mishra</dc:creator>
      <dc:date>2019-08-21T15:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Export all the datasets from work library in excel format with datasets name as excel sheet name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-all-the-datasets-from-work-library-in-excel-format-with/m-p/582867#M13885</link>
      <description>&lt;P&gt;Yes, use a libname instead to create the Excel file and PROC COPY to copy the data sets from the input library, WORK in your example, to the new file, outfile.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname outfile xlsx "&amp;amp;path.\Forecast.xlsx";

proc copy in=work out=outfile;
run;

libname outfile;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89957"&gt;@chandan_mishra&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to export all the tables from work library in excel format with dataset names as sheet names:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let path = "C:\Users\Data";



PROC EXPORT DATA= Data1 OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET='Data1';
RUN;


PROC EXPORT DATA= SecondData OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET='SecondData';
RUN;



PROC EXPORT DATA= Data3 OUTFILE="&amp;amp;path.\Forecast.xlsx" DBMS=xlsx REPLACE;
SHEET=''Data3";
RUN;

&lt;/PRE&gt;
&lt;P&gt;As can be seen, I have to write the same code multiple times to export the data in the same excel file with dataset name as sheet names. Is there any way, I can write one Proc export and just export all the datasets available in the work library in the excel format with dataset names as sheet names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Chandan Mishra&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 15:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-all-the-datasets-from-work-library-in-excel-format-with/m-p/582867#M13885</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-21T15:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Export all the datasets from work library in excel format with datasets name as excel sheet name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-all-the-datasets-from-work-library-in-excel-format-with/m-p/582877#M13888</link>
      <description>&lt;P&gt;Thanks Reeza. This works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 16:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-all-the-datasets-from-work-library-in-excel-format-with/m-p/582877#M13888</guid>
      <dc:creator>chandan_mishra</dc:creator>
      <dc:date>2019-08-21T16:09:31Z</dc:date>
    </item>
  </channel>
</rss>

