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

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
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

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
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

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
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

Thanks for your time Reeza!!! Smiley Happy

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