BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
woo
Barite | Level 11 woo
Barite | Level 11

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

6 REPLIES 6
Reeza
Super User

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";

woo
Barite | Level 11 woo
Barite | Level 11

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!!!

Reeza
Super User

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

woo
Barite | Level 11 woo
Barite | Level 11

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....

Reeza
Super User

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.

woo
Barite | Level 11 woo
Barite | Level 11

Thanks for your time Reeza!!! Smiley Happy

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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