Help using Base SAS procedures

Exporting output to a particular sheet in XL. by using ods

Reply
Regular Contributor
Posts: 229

Exporting output to a particular sheet in XL. by using ods

Hi

I have a excel sheet by name Report now i want to export another output to that Report .xls file(in to another sheet2.)in ods.How can i do it Message was edited by: Michel_SAS
SAS Super FREQ
Posts: 8,743

Re: Exporting output to a particular sheet in XL. by using ods

Hi:
I believe that the only ways you can ADD a worksheet to an existing workbook are to use the LIBNAME engine or PROC EXPORT. If you use ODS TAGSETS.EXCELXP, ODS CSV, or ODS HTML, the entire file (what you put in the FILE= option of ODS) is overwritten with the new report information.

One approach, then is to recreate the entire workbook -- both the existing worksheet named Report (assuming you created it with SAS) and the new worksheet. If you were using BY group processing, this would be as easy as adding BY BYVARIABLE to your procedure syntax and then each bygroup would get a separate worksheet.

Otherwise, I have heard some folks read the first sheet into SAS and then write it back out along with any new information to the same named workbook.
Some useful papers that talk about using TAGSETS.EXCELXP:
http://support.sas.com/rnd/papers/sgf07/sgf2007-excel.pdf
http://www2.sas.com/proceedings/forum2008/192-2008.pdf

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 99 views
  • 0 likes
  • 2 in conversation