<?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: Create different XLS files named after the groups in the BY statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-different-XLS-files-named-after-the-groups-in-the-BY/m-p/508933#M1709</link>
    <description>1. Not easily, a macro or call execute is usually the fastest way&lt;BR /&gt;&lt;BR /&gt;2. No. ODS TAGSETS genreates an XML file, not an actual xls file so SAS cannot reimport the data easily. If you convert it to a native XLS file then it can be reimported. &lt;BR /&gt;&lt;BR /&gt;If you have SAS 9.4 TS1M3+ you can generate native xlsx files.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Oct 2018 20:42:54 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-30T20:42:54Z</dc:date>
    <item>
      <title>Create different XLS files named after the groups in the BY statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-different-XLS-files-named-after-the-groups-in-the-BY/m-p/508901#M1707</link>
      <description>&lt;P&gt;Dear all,&lt;BR /&gt;&lt;BR /&gt;Hope you're doing OK &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I come to you because of the following: I need to generate a different XLS file for each group in a BY statement.&lt;BR /&gt;&lt;BR /&gt;Also important: the name of each file should be the corresponding category from the BY statement.&lt;BR /&gt;&lt;BR /&gt;As of now, I'm working with the following code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    ods tagsets.excelxp file='multisheet.xls' style=statistical
      options( sheet_interval='bygroup' );

        proc sort data=PRUEBA_COM out=class;
     by attribute_4;
  run;

  proc print data=class;
     by attribute_4;
  run;

  ods tagsets.excelxp close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(Code obtained from: &lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#data" target="_blank"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#data&lt;/A&gt;)&lt;BR /&gt;&lt;BR /&gt;That code gives me a sheet from each BY group (which is fine) and the name of each sheet is "attribute_4=xxxx" (which is also fine).&lt;BR /&gt;&lt;BR /&gt;The thing is they all are in a single file ("multisheet.xls"). So, my questions are as follows:&lt;BR /&gt;&lt;BR /&gt;1) Do you know of any other way to generate single XLS files and name them after their BY category?&lt;BR /&gt;&lt;BR /&gt;2) If not, is there a way to re-import this Excel file ("multisheet") and split the sheets afterwards in different XLS files named after each sheet's name?&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 19:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-different-XLS-files-named-after-the-groups-in-the-BY/m-p/508901#M1707</guid>
      <dc:creator>Rafa</dc:creator>
      <dc:date>2018-10-30T19:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create different XLS files named after the groups in the BY statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-different-XLS-files-named-after-the-groups-in-the-BY/m-p/508933#M1709</link>
      <description>1. Not easily, a macro or call execute is usually the fastest way&lt;BR /&gt;&lt;BR /&gt;2. No. ODS TAGSETS genreates an XML file, not an actual xls file so SAS cannot reimport the data easily. If you convert it to a native XLS file then it can be reimported. &lt;BR /&gt;&lt;BR /&gt;If you have SAS 9.4 TS1M3+ you can generate native xlsx files.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Oct 2018 20:42:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-different-XLS-files-named-after-the-groups-in-the-BY/m-p/508933#M1709</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-30T20:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create different XLS files named after the groups in the BY statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-different-XLS-files-named-after-the-groups-in-the-BY/m-p/508965#M1714</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;says, you'' probably need to wrap your logic in a simple SAS macro.&amp;nbsp; But don't be intimidated -- you can do it!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start simple, getting the program to work for one group.&amp;nbsp; Then slowly add the macro logic around your process until you've got it all working.&amp;nbsp; &lt;A href="https://blogs.sas.com/content/sasdummy/2012/03/20/sas-program-by-processing/" target="_self"&gt;Here's an example (with steps) that you can follow here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 22:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-different-XLS-files-named-after-the-groups-in-the-BY/m-p/508965#M1714</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-10-30T22:28:26Z</dc:date>
    </item>
  </channel>
</rss>

