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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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