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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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