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
SAS Super FREQ
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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