BookmarkSubscribeRSS Feed
Helle
Calcite | Level 5
Hi,

I would like to rename the individual worksheets when creating Excel files using the libname statement so that the name of the sheet does not have to be equal to the name of the dataset. Is there an option similar to the sheet='YY' option in PROC Export?

Here's a code sample:

libname outxls excel 'H:\HLI\example_out2.xls' ;
data outxls.report_2009 (dblabel=yes);
set sasuser.report_2009;
run;
LIBNAME outxls CLEAR;

Thanks,

Helle
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
If you did this:
[pre]
libname outxls excel 'H:\HLI\example_out2.xls' ;

data outxls.wombat (dblabel=yes);
set sasuser.report_2009;
run;

LIBNAME outxls CLEAR;
[/pre]

Then the name of the sheet would be 'wombat'....there is no sheet= option such as that used with PROC EXPORT.

cynthia
Helle
Calcite | Level 5
Hi Cynthia,

Thanks for bringing this very obvious solution to my attention 🙂

Helle

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 2 replies
  • 1567 views
  • 0 likes
  • 2 in conversation