BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi
I have requirement to export report output to excel using the below piece of code as a Stored Process at runtime
I have Microsoft office 2007.
/**************************************/
%global _odsdest _odsoptions ;
%let _odsdest = tagsets.excelXP;
%let _odsoptions =;
%let rv = %sysfunc(appsrv_header(Content-type,application/vnd.ms-excel));
%stpbegin;
proc print data=sashelp.class;
run;
%stpend;
/**************************************/
So Kindly let me know whether it is supported or not or there is any other alternative
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
The APPSRV_HEADER function was designed for use with SAS/IntrNet. The STPSRV_HEADER function is the one to use for stored processes. I have never used a %LET statement and %SYSFUNC to change the value of the the content-type header, so I can't comment on whether that is appropriate or not.

The only thing I can tell you is that if you use the tagsets.ExcelXP destination, you are creating a stored process that can only be executed in/from a limited number of client applications. You can execute this SP from the Portal, from the Stored Process Web Application (via URL). You could execute this from a custom front end -- JSP or whatever.

You MAY be able to execute this SP from within EG; however you will NOT be able to execute this SP from within the SAS/Addin for Microsoft Office. Word only "accepts" HTML, RTF or SASReport XML results from a SP; Excel only "accepts" HTML, CSV or SASReport XML results from an SP; and PPT only "accepts" SASReport XML from an SP.

There have been several examples of using STPSRV_HEADER with stored processes that have already been posted to this forum. You should be able to find them with a search on STPSRV_HEADER in the forum search box.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1018 views
  • 0 likes
  • 2 in conversation