BookmarkSubscribeRSS Feed
richardmgb
Fluorite | Level 6

I have several sas programs that each output a dataset. I've written a driver program that will call all of them. Now I want to add on a potion that will output the datasets together in an excel file and each dataset to have a separate tab/sheet. Anybody know how I can do this? Thank you so much!

3 REPLIES 3
Patrick
Opal | Level 21

With SAS 9.4 it could be as simple as in below code. With earlier versions you would need to use one of the other well documented and often discussed methods.

data libnames;

  set sashelp.vlibnam;

run;

data members;

  set sashelp.vmember;

run;

libname test xlsx 'c:\test\text.xlsx';

data test.libnames;

  set libnames;

run;

data test.members;

  set members;

run;

libname test clear;

richardmgb
Fluorite | Level 6

Thank you so much, Patrick! Could you please give me a link or where I can find that? I really appreciate your help Smiley Happy

Patrick
Opal | Level 21

You can start here How do I export from SAS to Excel files: Let me count the ways - The SAS Dummy and then once you've decided which technique is appropriate for you, you can look up more details.

If I want to find something on the SAS support sites then I normally use Google with:   site:support.sas.com search terms


Or just here in this forum's search when I type in something like "write to excel tab" I get several promising links back.

Capture.PNG

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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 990 views
  • 0 likes
  • 2 in conversation