<?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: Split table in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2738#M901</link>
    <description>thank you for your answer.&lt;BR /&gt;
&lt;BR /&gt;
In fact, ExcelXp asks to use a recent Excel version, and I don't have this.&lt;BR /&gt;
&lt;BR /&gt;
About the automation, I agree I can use macro code, what I said at the beginning of this post. But I would want to see with the true EG tasks.&lt;BR /&gt;
&lt;BR /&gt;
Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Tue, 10 Apr 2007 18:34:40 GMT</pubDate>
    <dc:creator>Stephane</dc:creator>
    <dc:date>2007-04-10T18:34:40Z</dc:date>
    <item>
      <title>Split table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2733#M896</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
Suppose I have in EG 4 a table that shows customers by shop : customer_ID, Shop_ID, Interesting_informations ...&lt;BR /&gt;
&lt;BR /&gt;
How can I create a table by shop to export each of them into a separate excel file ?&lt;BR /&gt;
&lt;BR /&gt;
In SAS base and a %do loop I see very well, but with EG 4 tasks ... &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Ho do you do that ?&lt;BR /&gt;
&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
Stephane</description>
      <pubDate>Fri, 06 Apr 2007 15:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2733#M896</guid>
      <dc:creator>Stephane</dc:creator>
      <dc:date>2007-04-06T15:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Split table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2734#M897</link>
      <description>I am not sure I understand completely, but you should be able to create multiple filter/query nodes, one for each shop.  The result would be a table for each query.&lt;BR /&gt;
&lt;BR /&gt;
For example, if I have order data that includes the sales region (North South, East, West).  I could create a query node in the project that sets the filter (region EQ "North"), another query node with the filter (Region EQ "South"), etc.&lt;BR /&gt;
&lt;BR /&gt;
I recognize that this isn't going to be simple if you have lots of unique values, but if it's a known set of values, it should be approachable.</description>
      <pubDate>Fri, 06 Apr 2007 19:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2734#M897</guid>
      <dc:creator>DavidHenderson</dc:creator>
      <dc:date>2007-04-06T19:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Split table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2735#M898</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
no I think you understood &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
the idea is : &lt;BR /&gt;
&lt;BR /&gt;
data shop1 shop2;&lt;BR /&gt;
set shops;&lt;BR /&gt;
if shop_ID = 1 then output shop1;&lt;BR /&gt;
else if shop_ID = 2 then output shop2;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Proc export data= shop1; ... run;&lt;BR /&gt;
&lt;BR /&gt;
I have to many shops to do that manually and I have the same thing to do by region after , and so on.&lt;BR /&gt;
&lt;BR /&gt;
the final result would be an excel file by shop in order to publish each of them to each shop.&lt;BR /&gt;
I relatively open to publish the files in another way if the solution exists.&lt;BR /&gt;
Otherwise, I go on SAS base node to do that.</description>
      <pubDate>Sat, 07 Apr 2007 08:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2735#M898</guid>
      <dc:creator>Stephane</dc:creator>
      <dc:date>2007-04-07T08:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Split table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2736#M899</link>
      <description>Stephane,&lt;BR /&gt;
&lt;BR /&gt;
Actually, that's exactly the process that David proposed; the queries are the functional equivalent of your data steps.  It is a bit cumbersome and does not support the automation for an unknow list of shops or regions.&lt;BR /&gt;
&lt;BR /&gt;
There are several examples of macros on SAS-L of base code to export a series of datasets where the number and names of the datasets are a function of the incoming data.  If you have licensed the additional extensibility features, you could incorporate the macro directly into your EGuide flow.  Otherwise, you could incorporate them through a code node.&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier</description>
      <pubDate>Mon, 09 Apr 2007 16:54:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2736#M899</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2007-04-09T16:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Split table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2737#M900</link>
      <description>I am not sure this will work for you, but if you use the ODS Tagsets.EXCELXP system and use proc tabulate, and do it "by ID", SAS will put each table for each ID on a separate sheet withing the same XLS file.  That is not a separate XLS file for each ID, but it may help or work.  If you have a large number of IDs, it is a one-liner to create the separate sheets.</description>
      <pubDate>Tue, 10 Apr 2007 14:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2737#M900</guid>
      <dc:creator>JohnH</dc:creator>
      <dc:date>2007-04-10T14:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Split table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2738#M901</link>
      <description>thank you for your answer.&lt;BR /&gt;
&lt;BR /&gt;
In fact, ExcelXp asks to use a recent Excel version, and I don't have this.&lt;BR /&gt;
&lt;BR /&gt;
About the automation, I agree I can use macro code, what I said at the beginning of this post. But I would want to see with the true EG tasks.&lt;BR /&gt;
&lt;BR /&gt;
Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 10 Apr 2007 18:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2738#M901</guid>
      <dc:creator>Stephane</dc:creator>
      <dc:date>2007-04-10T18:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Split table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2739#M902</link>
      <description>Hi:&lt;BR /&gt;
  One other thing you could try is this:&lt;BR /&gt;
            &lt;BR /&gt;
In EG&lt;BR /&gt;
Tools--&amp;gt; Options --&amp;gt; Results General&lt;BR /&gt;
Make sure that ONLY HTML is checked under Results Formats&lt;BR /&gt;
             &lt;BR /&gt;
Then under Tasks --&amp;gt; Custom Code&lt;BR /&gt;
check insert custom code before task and click EDIT&lt;BR /&gt;
             &lt;BR /&gt;
Then type this into the custom Code window:[pre]&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
ods msoffice2k file='c:\temp\Shop1.xls' style=egdefault&lt;BR /&gt;
                       newfile=bygroup;&lt;BR /&gt;
 [/pre]                 &lt;BR /&gt;
Click SAVE in the code window.&lt;BR /&gt;
              &lt;BR /&gt;
Then click EDIT for the After code choice and type this:&lt;BR /&gt;
[pre] ods _all_ close; [/pre]&lt;BR /&gt;
               &lt;BR /&gt;
Then click SAVE to close this custom code window.&lt;BR /&gt;
Click OK to close the Options window.&lt;BR /&gt;
           &lt;BR /&gt;
Then choose your Data for the shops and choose &lt;BR /&gt;
Describe --&amp;gt; List Data&lt;BR /&gt;
           &lt;BR /&gt;
Choose your variables for the List data task (or some other task).Be sure to use &lt;BR /&gt;
your SHOP variable as the "group by" variable. (so that SAS generates a BY &lt;BR /&gt;
statement for BY SHOP.&lt;BR /&gt;
   &lt;BR /&gt;
You are not REALLY creating an Excel file, but you ARE creating an HTML file &lt;BR /&gt;
using MSOFFICE2K (Microsoft specific HTML) that Excel can open. EG will only &lt;BR /&gt;
show you the first file that you create in the project window (Shop1.xls), but, if you&lt;BR /&gt;
 go to the c:\temp directory (outside of EG), then you should see all your SHOP &lt;BR /&gt;
 files there -- SHOP1.xls thru SHOP??.xls that you can then open with Excel. &lt;BR /&gt;
  &lt;BR /&gt;
Now, this does not get them into one workbook, but into multiple workbooks using &lt;BR /&gt;
 the NEWFILE= logic. And, of course, after you're done, you have to remember to&lt;BR /&gt;
 go back and clear out the custom code nodes.&lt;BR /&gt;
       &lt;BR /&gt;
At this point, you'd probably be just as well off to build a code node to either use &lt;BR /&gt;
 PROC EXPORT or the LIBNAME Excel engine to create a single workbook with &lt;BR /&gt;
 multiple sheets in a code node. Here's the Proc Export method:[pre]&lt;BR /&gt;
 &lt;BR /&gt;
proc export data=sashelp.shoes(where=(Region EQ 'Pacific')) &lt;BR /&gt;
            outfile= "exp_method.xls" &lt;BR /&gt;
            dbms=excel2002 replace;&lt;BR /&gt;
     sheet="Pacific"; &lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc export data=sashelp.shoes(where=(Region EQ 'Asia')) &lt;BR /&gt;
            outfile= "exp_method.xls" &lt;BR /&gt;
            dbms=excel2002 replace;&lt;BR /&gt;
     sheet="Asia"; &lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 And here's the LIBNAME method:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  &lt;BR /&gt;
libname WrkBk excel 'lib_method.xls' ver=2002&lt;BR /&gt;
     &lt;BR /&gt;
data WrkBk.Asia;&lt;BR /&gt;
set sashelp.shoes;&lt;BR /&gt;
where region = 'Asia';&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
data WrkBk.Pacific;&lt;BR /&gt;
set sashelp.shoes;&lt;BR /&gt;
where region = 'Pacific';&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
libname WrkBk clear;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
You will need SAS/Access for PC file formats for either of these methods to work. &lt;BR /&gt;
 Or, if you're building a code node anyway and you want to create a workbook for &lt;BR /&gt;
 each shop, you could just put this ODS code into an EG code node:&lt;BR /&gt;
[pre]&lt;BR /&gt;
** close the ODS destination that EG opens by default;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
** create an MS Office HTML file -- and "fool" the Windows registry by;&lt;BR /&gt;
** giving the file an XLS extension. When you double click on the file;&lt;BR /&gt;
** FROM WINDOWS EXPLORER (not EG), you will launch Excel;&lt;BR /&gt;
   &lt;BR /&gt;
ods msoffice2k file='c:\temp\shop1.xls' style=egdefault&lt;BR /&gt;
                       newfile=bygroup;&lt;BR /&gt;
    &lt;BR /&gt;
*** your procedure of choice with;&lt;BR /&gt;
by shop;&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
ods _all_ close;[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Good luck,&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 10 Apr 2007 20:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Split-table/m-p/2739#M902</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-04-10T20:02:52Z</dc:date>
    </item>
  </channel>
</rss>

