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-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!

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.

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