Hi,
Generally, folks use the SAS Add-in for Microsoft Office to be able to use Excel and 1) open SAS data files and data sources into Worksheets or 2) populate a worksheet with SP results or 3) run SAS analytical tasks on SAS data files or data sources. In this case, it doesn't matter where your data files physically reside or where your SP server is, as long as the folks who are using Excel have the right access privileges to the data and SPs.
So, I wonder what's going to happen to your Excel files on Unix once you create them? Presumably you're either going to open them FROM Windows with Excel OR you're going to open them on UNIX with some other software that reads Excel format files.
If you're going to open the Excel files with Windows, even though they reside on UNIX, then why not use the SAS Add-in for Microsoft Office? In this way, you have the full functionality of Excel with the added power of SAS to access data and/or run SPs.
If you're going to open the Excel format files on UNIX with some other software, then ... I'm not sure what client apps you would be using to execute your SP. What you want to do is really dependent on the client app that would be rendering the SP results.
The other challenge of file creation when you add SP into the mix is that with %stpbegin/%stpend you do NOT have any control over naming of the output file because the client application that runs the SP (Word or Excel or EG or PPT) is supposed to know how to render the results of the output. Right now, SpreadsheetML (TAGSETS.EXCELXP ) output is not accepted by the SAS Add-in for Microsoft Office. You can only execute SPs that return TAGSETS.EXCELXP output from within the Information Delivery Portal or your own custom invocation of a SP (using the Stored Process Web Application or the Stored Process API).
In this previous post,
http://support.sas.com/forums/thread.jspa?messageID=6617᧙
you indicated that you were using the Information Delivery Portal and %stpbegin method to return ExcelXP output. When you use the Portal, you do not have a fixed file name for your streamed output (unless you are publishing packages and NOT using streaming results) -- so there is really no way to do an append using a SP since %stpbegin does not let you set a file name. And, besides, with TAGSETS.EXCELXP, you cannot append to an existing SpreadsheetML XML file, however, because the XML specification for SpreadsheetML requires 1 and only 1
tag in the file.
There might be some way with a custom front end application using C++ or VB that you could grab the SP results and open the original Excel file behind the scenes and then append the streamed retults into a new worksheet -- but now you're essentially writing the same kind of application interface that you get out of the SAS Add-in for Microsoft Office.
Imagine this scenario -- every month, somebody has to add a new worksheet to the yearly workbook with the previous month's report/results. On Jan 31 or Feb 1, using the SAS Add-in for Excel, you run the SP in an empty workbook and make a worksheet for January. Then you save the Workbook. On Feb 28 or March 1, using the SAS Add-in for Excel, you open the yearly workbook, click to start a new worksheet and run the SP to make a worksheet for Feb. You keep doing this every month until your yearly workbook is complete. When you use this method, you don't really need to worry about using TAGSETS.EXCELXP and you can just return HTML results to Excel. Since the end user is in control of when the SPs populate the worksheets or add new worksheets, they can also control the name of the worksheet.
Anyway, just some more food for thought.
cynthia