BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Soham0707
Obsidian | Level 7

Hello all,

 

here, i want to export all the dataset from work library to an excel file.

Need code for that.

can anyone help me for this?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

PROC COPY

 

data one two three;
   set sashelp.class;
   run;
libname xl xlsx 'newbook.xlsx';
proc copy in=work out=xl;
   run;
libname xl clear;

View solution in original post

8 REPLIES 8
data_null__
Jade | Level 19

PROC COPY

 

data one two three;
   set sashelp.class;
   run;
libname xl xlsx 'newbook.xlsx';
proc copy in=work out=xl;
   run;
libname xl clear;
novinosrin
Tourmaline | Level 20

Guru @data_null__  Very neat. Does that handle exporting to multiple sheets appropriately with the naming convention?

 

Sorry, I am yet to test that sweet solution. Pardon me.

data_null__
Jade | Level 19

Yes in this case there are three sheet tabs named one two three.  

 

 


@novinosrin wrote:

Guru @data_null__  Very neat. Does that handle exporting to multiple sheets appropriately with the naming convention?

 

Sorry, I am yet to test that sweet solution. Pardon me.


 

Capture.PNG

Soham0707
Obsidian | Level 7

Thanks for reply.

But i want all the datasets  at once in one excel workbook having multiple sheets (sheets name must be the dataset name).  

 

Vince_SAS
Rhodochrosite | Level 12

Have you tried the code suggested by @data_null__ ?  I think it does what you ask.

 

Vince DelGobbo

SAS R&D

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 4309 views
  • 8 likes
  • 4 in conversation