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

Hello,

We have a STP program that uses the following belowfor the STP to output in Excel

data _null_;

 

/* Set HTTP headers */

  rc = stpsrv_header('Content-type','application/vnd.ms-excel');

 

 /* Prompt to SAVE or OPEN the attachment file named test.xls using Excel */

rc = stpsrv_header('Content-disposition','attachment; filename=filename.xls');

 

/* OR */ 

 /* Open results directly to Excel (browser-dependent) *

  rc = stpsrv_header('Content-disposition',"inline");  */

 

run;

 WHen using Proc Print it outputs to Excel ; but not if using PROC REPORT.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You will need to show how you are doing it.  If you proc report to ods tagsets.execelxp and call it xlsx then that is a mismatch as tagsets creates XML output. 

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

What is the proc print / proc report doing?  The reason being there are many ways to create Excel files - tagsets.excelxp, libname excel, etc.  It could also be that the proc report is not working and creating an invalid Excel file.  You haven't said what happens when the proc report is used, is there an error, does it open and there is no data, does nothing happen?  What does the log of the proc report say - maybe there is an error?  Maybe your missing a style, or you haven't specified columns in the proc report - I get this, when columnsis not given you wont get output.

jplarios
Quartz | Level 8

When running with PROC PRINT; Excel is opened however with PROC REPORT it attempts to open an unknown file type:

we get a File Doanload Prompt with the Name result._WEBOUTUnknown Type:Unknown File Typpe From: the location of the file.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

You will need to show how you are doing it.  If you proc report to ods tagsets.execelxp and call it xlsx then that is a mismatch as tagsets creates XML output. 

jplarios
Quartz | Level 8

thank you; your answer helps me clarify our issue.

 

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 2577 views
  • 1 like
  • 2 in conversation