<?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 all data sets from a library to excel? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-export-all-data-sets-from-a-library-to-excel/m-p/415994#M67587</link>
    <description>&lt;P&gt;Its a good idea to use the search for questions before posting, this question has been answered many times before.&amp;nbsp; Question 1 what version of SAS, if you are using 9.4 then it is very simple:&lt;/P&gt;
&lt;PRE&gt;libname tmp excel "&amp;lt;path to file&amp;gt;/&amp;lt;filename&amp;gt;.xlsx";
proc copy in=tmp out=work;
run;
libname tmp clear;&lt;/PRE&gt;
&lt;P&gt;And vice versa for writing out, swap in to work, and out to tmp.&amp;nbsp; (Assumes data is in the work library, change work to your library).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your not on 9.4, then it becomes harder.&amp;nbsp; Writing out you can do tagsets.excelxp, and a call execute, or a proc export, and call execute for each dataset.&lt;/P&gt;
&lt;PRE&gt;ods tagsets.excelxp file="&amp;lt;pathtofile&amp;gt;/&amp;lt;filename&amp;gt;.xml";

data _null_;
  set sashelp.vtable (where=(libname="WORK"));
  call execute(cat('ods tasgets.excelxp options(sheet_name="',strip(memname),'");'));
  call execute(cat('proc report data=work.',strip(memname),' nowd; columns _all_; run;'));
run;

ods tagsets.excelxp close;&lt;/PRE&gt;
&lt;P&gt;Reading in, there is no real way of doing automatically in &amp;lt; 9.4, you have to bodge it.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2017 12:09:30 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-11-24T12:09:30Z</dc:date>
    <item>
      <title>How to export all data sets from a library to excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-export-all-data-sets-from-a-library-to-excel/m-p/415991#M67586</link>
      <description>&lt;P&gt;&amp;nbsp;How to export all data sets from a library to excel? Example I'm containing "xyz" library contains 20 data sets I want it into excel in sheets? I'm aware about only one data set to export it into excel can anyone idea about it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This I'm aware about single data set to excel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc export data=work outfile='C:\Users\Nagaraju\Desktop\f.xlsx' dbms=xlsx;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And also if possible same for Import to sas datasets?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 11:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-export-all-data-sets-from-a-library-to-excel/m-p/415991#M67586</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-24T11:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to export all data sets from a library to excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-export-all-data-sets-from-a-library-to-excel/m-p/415994#M67587</link>
      <description>&lt;P&gt;Its a good idea to use the search for questions before posting, this question has been answered many times before.&amp;nbsp; Question 1 what version of SAS, if you are using 9.4 then it is very simple:&lt;/P&gt;
&lt;PRE&gt;libname tmp excel "&amp;lt;path to file&amp;gt;/&amp;lt;filename&amp;gt;.xlsx";
proc copy in=tmp out=work;
run;
libname tmp clear;&lt;/PRE&gt;
&lt;P&gt;And vice versa for writing out, swap in to work, and out to tmp.&amp;nbsp; (Assumes data is in the work library, change work to your library).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your not on 9.4, then it becomes harder.&amp;nbsp; Writing out you can do tagsets.excelxp, and a call execute, or a proc export, and call execute for each dataset.&lt;/P&gt;
&lt;PRE&gt;ods tagsets.excelxp file="&amp;lt;pathtofile&amp;gt;/&amp;lt;filename&amp;gt;.xml";

data _null_;
  set sashelp.vtable (where=(libname="WORK"));
  call execute(cat('ods tasgets.excelxp options(sheet_name="',strip(memname),'");'));
  call execute(cat('proc report data=work.',strip(memname),' nowd; columns _all_; run;'));
run;

ods tagsets.excelxp close;&lt;/PRE&gt;
&lt;P&gt;Reading in, there is no real way of doing automatically in &amp;lt; 9.4, you have to bodge it.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 12:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-export-all-data-sets-from-a-library-to-excel/m-p/415994#M67587</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-24T12:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to export all data sets from a library to excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-export-all-data-sets-from-a-library-to-excel/m-p/415997#M67588</link>
      <description>&lt;P&gt;Do a google search for "sas export multiple datasets to excel", and you'll find enough answers to keep you busy for days.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 12:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-export-all-data-sets-from-a-library-to-excel/m-p/415997#M67588</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-24T12:15:54Z</dc:date>
    </item>
  </channel>
</rss>

