BookmarkSubscribeRSS Feed
wreneau
Calcite | Level 5

Hi All,

Our users have the ability to run EG (Version 5.1 (5.100.0.12019) (64-bit))  reports from our web portal. I need the ability to output the results into excel quickly.

Basically, i need a new excel file to open and dump the data each time. Since this is accessed on each users local machine through our web portal I cannot have a 'template' excel workbook. EG needs to 'create' a new workbook each time.

Historically, I have been pasting the following into the .sas file and it works great unless the excel file is med-large. It is extremely slow for mid sized output (10min+).

data _null_;

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

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

run; 

I have tried the following two methods with no luck...

#1

/*I replace username with dynamic username*/

ods _all_ close;

ODS MARKUP TAGSET=TAGSETS.EXCELXP

file='/var/opt/data/userdata/username/testing.xls'

style = statistical;

proc print data=final noobs label; run;

ODS TAGSETS.EXCELP CLOSE;

ODS LISTING;

ERROR: Physical file does not exist, D:\var\opt\data\userdata\username\testing.xls.

ERROR: No body file. MARKUP output will not be created.

#2

%let download_from = %sysfunc(getoption(work))/test.xls;

filename src "&download_from.";

proc export

  data=final

  dbms=xls

  outfile=src

  replace;

run;

ERROR: DBMS type XLS not valid for export.

Any thoughts on what I am doing wrong?

1 REPLY 1
TomKari
Onyx | Level 15

In the first case, it looks like you're providing a file reference that isn't valid on the server that SAS is running on. Your SAS Admin. should be able to give you some insights into the file structure on the server.

Tom

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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