You can use the operating system command to copy the files. Since you have SAS available it can be used to generate the commands for you, but you could use any programming language.
Assume that want tom copy all files with extension .sas from one folder to another folder then you might use code like this.
%let indir=c:\saspgms ;
%let outdir= c:\txtpgms;
data _null_;
length infile outfile $256 extension $20 cmd $500 ;
infile "&indir\*.sas /b" pipe truncover ;
input infile $256. ;
extension = scan(infile,-1,'.');
if upcase(extension)='SAS';
outfile=cats(tranwrd(substr(infile,1,length(infile)-3),"&indir\","&outdir\"),'txt');
cmd=catx(' ','copy',quote(trim(infile)),quote(trim(outfile));
infile copy pipe filevar=cmd ;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.