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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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