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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3103 views
  • 8 likes
  • 4 in conversation