Your SAS programs, embedded in web apps and elsewhere

Run PROC EXPORT via SAS Web Report

Frequent Contributor
Posts: 75

Run PROC EXPORT via SAS Web Report


I'm trying to setup a job which exports a dataset to Excel on the network.

Prior to converting the job into a stored process, it exports fine to Excel.

When I convert the job into a stored process in Enterprise Guide, it also works fine.

When I try to create a SAS Web Report with a Stored Process, it executes, and I can see the work files when it's running, but the Excel file is never created.

I've tried changing the server from the Detault server (whick looks to be the workspace server) to the Stored Process server, and am not having any luck there.

Is this a limitation of SAS Web Reports?

I do not want to the Addin for Microsoft Office solution, due to licencing reasons and IT constraints we cannot do this.

The stored process doesn't ask for anything.

Essentially the code could be:

proc export

   data = sashelp.class

   outfile = "c:\class.csv"

   dbms = csv replace;


Then run the create stored process option in Enterprise Guide.

I'm running SAS 9.3 using Enterprise Guide 5.1 ( Hot fix 7 (32-bit) on Windows.


Posts: 1,226

Re: Run PROC EXPORT via SAS Web Report

By web report you mean Web Report Studio?

I know with the SAS Stored Process Web app you can have a stored process which runs and streams a csv or xml file back to the browser, and user gets a file save/download dialog box.  You need to set html headers and be sure to send streaming results.

WRS generally does package results (not streaming), and I think generally in SASREPORT format (?)   I don't really konw much about WRS.....

Posts: 8,739

Re: Run PROC EXPORT via SAS Web Report


  When you are using SAS Web Report Studio, the primary server that is used to run stored processes is the Workspace server. It is entirely likely that code that works in a "local" environment might not continue to work when run on the Workspace server. SAS Web Report Studio is a Java Application -- it uses SAS Report XML as the report format and when you run a stored process the expectation is that you will return results to the Web Report Studio interface -- in SAS Report XML format. Usually, stored processes that execute on either the stored process server or the workspace server do *NOT* have visibility of your local C: drive. But I am confused like Quentin because you refer to stored processes, so the "SAS Web Reports" is not a term that is usually associated with stored processes. Usually, people are referring to SAS Web Report Studio.

  However, you can also use Base SAS to create "plain" HTML files, which could also be considered "Web Reports", but not necessarily have anything to do with stored processes. So your terminology and description of the issue is confusing.


Frequent Contributor
Posts: 75

Re: Run PROC EXPORT via SAS Web Report

Sorry, I was lazy, yes, I did mean using SAS Web Report Studio.

In in SAS Web Report Studio, I've attempted to create a SAS Web Report (usually has a suffix of .srx, what do people usually call this?).  In that SAS Web Report, I have put in a Stored Process (as opposed to a table, or graph, etc).

I want the Excel file created when the user visits this page.  They have no access to SAS Enterpride Guide.  I would be very happy to create plain HTML files, but I wouldn't know how to have a Stored Process execute?

My example of C: drive was too simplistic in hindsight, it's actually going to a place on the network.  The workspace server should have visibility of the spot that I'm attemping to export to.

It doesn't have to be a Stored Process, it can be anything, I just couldn't think of a better way of doing this.

Note, I already have a SAS Web Report, with a Stored Process that just lists all the data, the nice thing is it doesn't display thousands of records, but only the first 40.  The user in turn clicks on the export button, and they get a zip file.  They extract it, open the Excel file, and then save it as another Excel file.  I felt that this was quite a long round-about way to get a listing of data in Excel.

What I want is for a user to be able to visit something which in turns generates an Excel file (a dump of a SAS dataset) on the network.  Whilst the Addin for Microsoft Office sounds ideal, I have two issues with it, licencing and even installing it.  If licencing wasn't an issue, I would have contacted technical support for help on that.  I don't want to generate a dump of the data everyday.


Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation