Your SAS programs, embedded in web apps and elsewhere

Streaming output from a SAS® Stored Process to MULTIPLE Microsoft Excel files

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Streaming output from a SAS® Stored Process to MULTIPLE Microsoft Excel files

Hi,

I would like to stream output from a stored process to multiple excel files for multiple datasets.

I've tried this for one dataset: 40683 - Streaming output from a SAS® Stored Process to Microsoft Excel

This works fine for one dataset to one excel file.

Is it possible to do this in one stored process for multiple datasets to multiple excel files via the excel popup window?

Thanks in advance.

Regards,

Berry


Accepted Solutions
Solution
‎12-20-2013 12:09 PM
SAS Super FREQ
Posts: 304

Re: Streaming output from a SAS® Stored Process to MULTIPLE Microsoft Excel files

Posted in reply to bheerschop

Web browsers cannot handle downloading multiple files at once.

The MIME headers that are set using the STPSRV_HEADER function are sent to the Web browser before the data stream.  The browser interprets the headers and then determines what to do with the data stream that follows. You cannot send multiple MIME headers between data streams, meaning in your case, you can only open a single output stream using Excel.  This is standard HTTP behavior and is not an issue with SAS.


Vince DelGobbo

SAS R&D

View solution in original post


All Replies
Solution
‎12-20-2013 12:09 PM
SAS Super FREQ
Posts: 304

Re: Streaming output from a SAS® Stored Process to MULTIPLE Microsoft Excel files

Posted in reply to bheerschop

Web browsers cannot handle downloading multiple files at once.

The MIME headers that are set using the STPSRV_HEADER function are sent to the Web browser before the data stream.  The browser interprets the headers and then determines what to do with the data stream that follows. You cannot send multiple MIME headers between data streams, meaning in your case, you can only open a single output stream using Excel.  This is standard HTTP behavior and is not an issue with SAS.


Vince DelGobbo

SAS R&D

Occasional Contributor
Posts: 15

Re: Streaming output from a SAS® Stored Process to MULTIPLE Microsoft Excel files

Posted in reply to Vince_SAS

Thank you.

Very clear answer.

Regards,

Berry

Regular Contributor
Posts: 155

Re: Streaming output from a SAS® Stored Process to MULTIPLE Microsoft Excel files

Posted in reply to bheerschop

You can create multiple Excel reports in one stored process request and return an HTML page that uses the replay program to allow the user to download the files one at a time.

Here is the doc to the replay program:

SAS/IntrNet(R) 9.2: Application Dispatcher - Replay Program 

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1224 views
  • 0 likes
  • 3 in conversation