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.
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.
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.
data shop1 shop2;
if shop_ID = 1 then output shop1;
else if shop_ID = 2 then output shop2;
Proc export data= shop1; ... run;
I have to many shops to do that manually and I have the same thing to do by region after , and so on.
the final result would be an excel file by shop in order to publish each of them to each shop.
I relatively open to publish the files in another way if the solution exists.
Otherwise, I go on SAS base node to do that.
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.
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.
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.
Tools--> Options --> Results General
Make sure that ONLY HTML is checked under Results Formats
Then under Tasks --> Custom Code
check insert custom code before task and click EDIT
Then type this into the custom Code window:[pre]
ods _all_ close;
ods msoffice2k file='c:\temp\Shop1.xls' style=egdefault
Click SAVE in the code window.
Then click EDIT for the After code choice and type this:
[pre] ods _all_ close; [/pre]
Then click SAVE to close this custom code window.
Click OK to close the Options window.
Then choose your Data for the shops and choose
Describe --> List Data
Choose your variables for the List data task (or some other task).Be sure to use
your SHOP variable as the "group by" variable. (so that SAS generates a BY
statement for BY SHOP.
You are not REALLY creating an Excel file, but you ARE creating an HTML file
using MSOFFICE2K (Microsoft specific HTML) that Excel can open. EG will only
show you the first file that you create in the project window (Shop1.xls), but, if you
go to the c:\temp directory (outside of EG), then you should see all your SHOP
files there -- SHOP1.xls thru SHOP??.xls that you can then open with Excel.
Now, this does not get them into one workbook, but into multiple workbooks using
the NEWFILE= logic. And, of course, after you're done, you have to remember to
go back and clear out the custom code nodes.
At this point, you'd probably be just as well off to build a code node to either use
PROC EXPORT or the LIBNAME Excel engine to create a single workbook with
multiple sheets in a code node. Here's the Proc Export method:[pre]
proc export data=sashelp.shoes(where=(Region EQ 'Asia'))
And here's the LIBNAME method:
libname WrkBk excel 'lib_method.xls' ver=2002
where region = 'Asia';
where region = 'Pacific';
libname WrkBk clear;
You will need SAS/Access for PC file formats for either of these methods to work.
Or, if you're building a code node anyway and you want to create a workbook for
each shop, you could just put this ODS code into an EG code node:
** close the ODS destination that EG opens by default;
ods _all_ close;
** create an MS Office HTML file -- and "fool" the Windows registry by;
** giving the file an XLS extension. When you double click on the file;
** FROM WINDOWS EXPLORER (not EG), you will launch Excel;