In reply to Renata.

Renata, this is a great question to post into the SAS Support Communities. I see that you're a member! There are some deep experts in ODS EXCEL there -- try the ODS and Base Reporting board.

Quickly though...

You can change the ODS EXCEL options "mid stream". Best practice is to assign an ID to your initial ODS EXCEL destination:

ODS EXCEL (ID=myreport) FILE=&OUTFILE01.
OPTIONS(EMBEDDED_TITLES='YES'
...

Then if you want to change the SHEET_INTERVAL behavior in-between PROC steps, add a statement like:

ODS EXCEL (ID=myreport) OPTIONS(SHEET_INTERVAL='proc');

This keeps the current Excel destination open but changes the output behavior for subsequent steps. Beyond this, if you have the detail data that you want to simply add to the workbook after ODS EXCEL CLOSE, then you can use PROC EXPORT -- one step per set of data that you want to add. If it's a single data source with BY groups that you want to break up, I think you'll have to iterate and have a PROC EXPORT for each BY value. Might need to use a macro loop to iterate through them.