BookmarkSubscribeRSS Feed
AlexeyS
Pyrite | Level 9

Hello, 

I want to move directory as is that contains excel files from one location to another. Which way is the most appropriate?

I have a SAS 9.3 version.

Thank you

4 REPLIES 4
kelxxx
Quartz | Level 8

You can try this. It works for me

options noxwait;
%let source_path= C:\Users\PNG\Documents;
%let file_name= test.xlsx;
%let destination_path=C:\users\png;
X move &source_path\&file_name &destination_path;

Please give me a like if you find it useful.Thanks!

SASKiwi
PROC Star

What OS does your SAS session run on? The required OS command and syntax to move the files depends on the OS. Your SAS session will also need to be able to access OS commands. You can check the required SAS option like this:

proc options option = xcmd;
run;
Sajid01
Meteorite | Level 14

The best approach would be to do it at the operating system level.
If the source and destination locations are on different computers, then ftp clients like filezilla would be helpful.

AllanBowe
Barite | Level 11

If you don't have XCMD enabled you can use this macro to recursively copy a directory from one place to another:  https://core.sasjs.io/mp__copyfolder_8sas.html

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 747 views
  • 0 likes
  • 5 in conversation