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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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