Thursday, June 9, 2011

A SAS Stored Process Web Application that exports a Dataset to an Excel sheet

While creating Drill down reports, you might need to provide the users with the option of downloading the entire data to an excel sheet. For this you may need to create an interface(Code) where the Export button is displayed and a stored process that converts the Dataset to the excel sheet.

/******Code for Converting the data to excel ******/

data _null_;
rc=stpsrv_header('Content-disposition','attachment; filename=temp.xls');
ods tagsets.excelxp file=_webout style=sasweb options(embedded_titles="yes"
print_header='&B&CThis is a test'
print_footer='&B&CThis is a footer printed on &D');
title "Export To Excel";
proc print data=&DSN ;
ods tagsets.excelxp close;


  1. HI

    I am using SAS EG 5.1 and creating a stored process to output a report to excel..I followed the same steps and but I get only a blank page. I am not sure what am I missing. Can you help me please.

  2. Hello Bhuvana,
    I have created a stored process for conversion of data to an excel sheet,but it works,no issues with. SAS Enterprise miner

  3. Thanks a lot.This was very helpful.

  4. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep training in Chennai

  5. very good blog, for more information of SAS BI tutorials Check this site Mindmajix for indepth SAS BI Tutorials

    Go here if you’re looking for information on SAS BI Blogs


  6. The structs is a complex data type declaration used in the C programming language that helps you to define a physically grouped list of variables to be placed under one name in a block of memory.
    struts training in chennai | struts training | struts training center in chennai

  7. I agree with your post. Android software development kit makes the application development process lot simpler and effective. You can create best performing android application with ease. Android Training Institutes in Chennai | Android Training in Chennai

  8. Nice Blog for SAS BI Beginers. I found your blog very interesting and very informative. SAS is widely used in clinical trial data analysis in a pharmaceutical, biotech and clinical research companies. More Details about sas clinical.