BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Hello, 

 

I am using SAS EG 7.13 , and I need to create an Excel file with two different sheets containing title (see the provided worksheet). I the first sheet will be filled-up first then close.  The data will be bring into the second sheet using another sas program ( it is why , I am looking for an append option).

 

Can we do this task with ods or with another one.

 

 

1 ACCEPTED SOLUTION
5 REPLIES 5
ChrisHemedinger
Community Manager

You can add multiple sheets to an ODS EXCEL destination by using the SHEET_INTERVAL options.  You can break sheets along PROC boundaries, tables, or arbitrary break points within your process by adjusting the SHEET_INTERVAL. 

 

However, once you close the destination with ODS EXCEL CLOSE, you cannot append the sheet with ODS EXCEL again.  ODS EXCEL (open) will always create/write over the XLSX file.

 

But PROC EXPORT can be used to add/replace sheets in an existing workbook.  I have an example of this here.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
alepage
Barite | Level 11

Hello,

 

The libname statement is a nice options but I think that I will loose my title1 and title2 into the worksheet.  Am I right.

 

ChrisHemedinger
Community Manager

Correct. PROC EXPORT and LIBNAME XLSX are for data only.  ODS EXCEL allows for report elements, including titles, footnotes, graphics, and generate report formatting with colors, etc.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
brb
Calcite | Level 5 brb
Calcite | Level 5

Goodness me, SAS is so limiting.  I am forced to use SAS for my current project which is why I am here.  Python has multiple ways of doing this easily.  Anyone new to SAS, save your time and money and learn Python or R instead.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 5 replies
  • 4612 views
  • 4 likes
  • 4 in conversation