BookmarkSubscribeRSS Feed
R_Win
Calcite | Level 5
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
1 REPLY 1
Cynthia_sas
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 877 views
  • 0 likes
  • 2 in conversation