I have a pre-canned macro for this named filemove. You can get it like this:
/* Grab a copy of the filemove macro */
%let thisMacro=filemove;
filename mCode "c:\temp\%qlowcase(&thisMacro).sas";
proc http url="https://raw.githubusercontent.com/SASJedi/sas-macros/master/%qlowcase(&thisMacro).sas"
out=mcode;
run;
%include mcode /source2;
filename mcode;
%&thismacro(?)
The macro call with the question mark writes documentation to the log:
NOTE: FILEMOVE documentation:
Purpose: Move a file from one directory to another
Syntax: %FILEMOVE(fileName, sourcePath,targetPath<,newFileName>)
fileName: Name of the file to be copied
sourcePath: path where the source file is located
targetPath: path to which the file will be moved
newFileName: OPTIONAL: New name for the copied file
Examples:
%FILEMOVE(abc.txt,c:\temp\source,c:\temp\target)
%FILEMOVE(old.csv,c:\temp\source,c:\temp\target,new.csv)
Use ? to print documentation to the SAS log.
To copy your file from one directory to another, something like this would do:
%fileMove(XDF_&column._&date._XDF_M2_&month..xlsx
,/opt/sas/data/xxx/xx/xx/xxx/FinalFolder
,/opt/sas/data/xx/xx/xx/xx/BridgeFolder);
... View more