BookmarkSubscribeRSS Feed
Fox_3
Calcite | Level 5

Friends,

In a project i am getting an 5 excel files every day and want to append these files in sas eg so can you please provide me sas macro code so i can import and append all this at one go.

2 REPLIES 2
PaigeMiller
Diamond | Level 26

See

http://www.sascommunity.org/wiki/Streamlining_Data-Driven_SAS_With_The_%25FOR_Macro

Scroll down to the last example named "Import all spreadsheets in all subfolders of a top folder"

--
Paige Miller
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Go back to source and ask them to supply data in a format other than Excel.  Even getting it in CSV format will allow you to write robust datastep imports, with wildcards so you don't need to loop over files.

Not particularly heplfull I know, but it will save you some headaches.  I will lay money on something will change in one of those Excel files at least once per import which will break your code.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 2 replies
  • 1605 views
  • 0 likes
  • 3 in conversation