BookmarkSubscribeRSS Feed
SASuserlot
Barite | Level 11

I am looking to combine all the excel files in folder starts with a specific into one file ( use each individual excel file as sheet in combine file) after combination delete individual files.  I am looking to do it instead of importing them back into SAS datasets and doing proc report. Is there a way I can do it through  using  xCMD or vbscript code running through the SAS. Thank you.

SASuserlot_0-1669066161549.png

 

3 REPLIES 3
Reeza
Super User
If they're all in one folder here's a script. https://www.codeproject.com/Tips/5264786/Merge-Many-Excel-Files-into-one-VBS
Last one on the page. I'd modify it to not use prompts and to have SAS pass the folder name.
Note that it combines all in a folder.

SASuserlot
Barite | Level 11

thank you @Reeza . I will work on this. Will let you know if I encounter issues or need any updates.

SASuserlot
Barite | Level 11

Hi @Reeza , I trying to use it, But I am struggling how to use the VBA code in SAS. Can you please provide some startup code to start on it.

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!

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
  • 423 views
  • 2 likes
  • 2 in conversation