Help using Base SAS procedures

PROC REPORT(no excel output ) vs PROC PRINT in a stored process when output is excel

Accepted Solution Solved
Reply
Regular Contributor
Posts: 163
Accepted Solution

PROC REPORT(no excel output ) vs PROC PRINT in a stored process when output is excel

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?


Accepted Solutions
Solution
‎02-22-2017 08:47 AM
Super User
Super User
Posts: 7,413

Re: PROC REPORT(no excel output ) vs PROC PRINT in a stored process when output is excel

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


All Replies
Super User
Super User
Posts: 7,413

Re: PROC REPORT(no excel output ) vs PROC PRINT in a stored process when output is excel

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.

Regular Contributor
Posts: 163

Re: PROC REPORT(no excel output ) vs PROC PRINT in a stored process when output is excel

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.

Solution
‎02-22-2017 08:47 AM
Super User
Super User
Posts: 7,413

Re: PROC REPORT(no excel output ) vs PROC PRINT in a stored process when output is excel

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. 

Regular Contributor
Posts: 163

Re: PROC REPORT(no excel output ) vs PROC PRINT in a stored process when output is excel

thank you; your answer helps me clarify our issue.

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 178 views
  • 1 like
  • 2 in conversation