Desktop productivity for business analysts and programmers

exporting multiple excel files from one folder to another

Accepted Solution Solved
Reply
Super Contributor
Super Contributor
Posts: 318
Accepted Solution

exporting multiple excel files from one folder to another

CAN SOMEONE PLEASE HELP ME HERE?

i have 35-40 excel files in one folder and i want to copy all those files to another folder how can i do it using SAS?

Thanks!


Accepted Solutions
Solution
‎12-18-2013 04:05 PM
Grand Advisor
Posts: 17,325

Re: exporting multiple excel files from one folder to another

Why using SAS?  Anyways, assuming Windows, you can use %sysexec copy, so you can use a pipe to get the list of files and move then that way.

The code to move one file is below:

%sysexec copy

    "Path to first file"

    "Path to second file";

View solution in original post


All Replies
Solution
‎12-18-2013 04:05 PM
Grand Advisor
Posts: 17,325

Re: exporting multiple excel files from one folder to another

Why using SAS?  Anyways, assuming Windows, you can use %sysexec copy, so you can use a pipe to get the list of files and move then that way.

The code to move one file is below:

%sysexec copy

    "Path to first file"

    "Path to second file";

Super Contributor
Super Contributor
Posts: 318

Re: exporting multiple excel files from one folder to another

Thanks Reeza - but for this i really hv to stuck with SAS code. Actually our people wants SAS code to do this transformation since i will include piece of code which would send email to my manager and users once all files have been transferred...

Thanks!!!

Grand Advisor
Posts: 17,325

Re: exporting multiple excel files from one folder to another

That is SAS code...its what I use to copy excel files in SAS Smiley Happy

Super Contributor
Super Contributor
Posts: 318

Re: exporting multiple excel files from one folder to another

Reeza - one more thing is - we will not sure how many excel files will be there each week....because this depends on users to have input for weekly or not - so one week we have 35 and other week may be 40....and we have to transfer all files every week, whatever it has...i really confuse with this....don't know what to use...

Thanks for your quick response....

Grand Advisor
Posts: 17,325

Re: exporting multiple excel files from one folder to another

Search the forum here, or google on using SAS to pipe in a list of file names from a directory.

25074 - Listing all files that are located in a specific directory

24820 - Creating a Directory Listing Using SAS for Windows

If you're on SAS 9.4 there's FCOPY (File Copy) but some basic google searches are coming up a few solutions out there already.

Super Contributor
Super Contributor
Posts: 318

Re: exporting multiple excel files from one folder to another

Thanks for your time Reeza!!! Smiley Happy

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 956 views
  • 3 likes
  • 2 in conversation