Hi:
The answer REALLY depends on what client application your end-users are going to use to surface the stored process results.
For example...if they will be using the SAS Add-in for Microsoft Office, then THEY can select CSV results from the SAS --> Options menu inside Excel. You don't have to do anything to your stored process if you allow them to make this choice. Ditto, if you write a "general" stored process and they select HTML as the result type -- then your stored process will come back as HTML -- using style information, such as font and colors -- if you allow them to make this choice.
You said that "using the code below produces a file that Excel can read but not our other software" -- what is the other software that you are using? You can return many different types of files with Stored Processes. This code should allow you to return a CSV file, assuming that the receiving software knows how to deal with a content-type header:
[pre]
Data _null_;
rc = stpsrv_header('Content-type','application/vnd.ms-excel;');
rc = stpsrv_header("Content-disposition","attachment; filename=PPR_Temp.xls");
run;
%let _odsdest=tagsets.csv;
*ProcessBody;
%stpbegin;
proc print data=sashelp.class;
run;
%stpend;
** OR an alternate method to code the stored process would be: ;
Data _null_;
rc = stpsrv_header('Content-type','application/vnd.ms-excel;');
rc = stpsrv_header("Content-disposition","attachment; filename=PPR_Temp.xls");
run;
ods csv file=_webout;
proc print data=sashelp.class;
run;
ods csv close;
[/pre]
Other destination values that you can use are:
%let _odsdest = tagsets.excelxp; /* Microsoft Spreadsheet ML XML results */
%let _odsdest = tagsets.msoffice2k; /* Microsoft HTML results */
%let _odsdest = tagsets.HTML3; /* W3C HTML 3.2 compliant tags */
But the chances are good that ONLY Excel will open the ExcelXP and MSOFFICE2K files AND, your software mayor may not deal with the HTTP content-type header correctly. If you used the tagsets.HTML3 destination AND your other software knows how to open W3C-compliant HTML files, this may be your best bet. There is a list of content-type headers associated with CSV files (http://filext.com/file-extension/CSV) If your application does not like
vnd.ms-excel as shown above,perhaps it wants to have one of these MIME type headers:
[pre]
text/comma-separated-values
text/csv
application/csv
application/excel
application/vnd.ms-excel
application/vnd.msexcel
[/pre]
You could also use PROC EXPORT, but as you can read from several previous threads, this generally will write the XLS file on the server machine -- NOT on the end-user's local machine.
Your best bet for a definitive response, given your particular configuration and the other software you need to use to open the stored process results file, might be to contact Tech Support:
http://support.sas.com/techsup/contact/index.html
cynthia