data results;
set pdf_corr;
length src dst dst2 $ 8 ; *create path to files;
source_file =catt("\\xxxxx\PDF_20230427\", NOM_PDF1);
dest_file = catt("\\xxxxx\PDF_20230427_V2\", NOM_PDF1); *create filerefs for copy function;
dest_file2 = dest_file = catt("\\xxxxx\PDF_20230427_V2\", NOM_PDF2);
rc1=filename(src,source_file,,'recfm=n');
rc2=filename(dst,dest_file,,'recfm=n');
rc2_1 = filename(dst2, dest_file2, , 'recfm=n');
rc3_1=fcopy(src,dst); *deassign filerefs;
rc3_2=fcopy(src,dst2); *deassign filerefs;
rc4=filename(src);
rc5=filename(dst);
rc6 = filename(dst2);
run;
Assuming you have another variable with the name, then the above is a brief example. If every file is copied multiple times you can generate those names and create a loop to loop over the names rather than repeat the code but it depends on exactly what you're doing.
... View more