BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

I wonder if there´s a way to let the user recieve an Excel-file with .xlsx-format from the stored process. I've been trying to use the new ods excel with file=_webout but not succedded. Any tips would be appreciated. See below the code I've been trying:

 

data _null_;
    rc = stpsrv_header('Content-type','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
    rc = stpsrv_header('Content-disposition','attachment; filename=Output.xlsx');
run;

*ProcessBody;

%STPBEGIN;

* Slutet på EG-generad kod (redigera inte den här raden);

ods excel file=_webout style=seaside options(sheet_name="Beståndslista" embedded_titles="on" embed_titles_once="on");

title "Sashelp.class";

proc print data=sashelp.class noobs label;
run;

ods excel close;

* Början på EG-genererad kod (redigera inte den här raden);
;*';*";*/;quit;
%STPEND;

1 ACCEPTED SOLUTION

Accepted Solutions
MagnusGustavsson
Fluorite | Level 6

I found a solution in the posting "ODS EXCEL in Web StoreProcess".

It seems like I just have to remove the %STPBEGIN; and %STPEND; macro calls. I´m not sure why but it works now 😃

 

Thanks for your reply.

View solution in original post

2 REPLIES 2
VasilijNevlev
Quartz | Level 8
Hello Magnus,

What result or error do you get? What SAS version do you run?

Be mindful that if you are on version below 9.4 TS1M1, you won't have access to SpreadsheetML template that was introduced in that version.

If you are on older version and you want excel file out, there are other ways of doing it.

Regards,
Vasilij
=======================================
For more information about {An}alytium, visit https://www.analytium.co.uk
MagnusGustavsson
Fluorite | Level 6

I found a solution in the posting "ODS EXCEL in Web StoreProcess".

It seems like I just have to remove the %STPBEGIN; and %STPEND; macro calls. I´m not sure why but it works now 😃

 

Thanks for your reply.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 877 views
  • 0 likes
  • 2 in conversation