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

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

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