To what @Ksharp and @Kurt_Bremser have already wrote, if you want to see more information about "why it didn't work?", use the following trick:
data _null_;
rc = rename(...);
rctxt=sysmsg();
if rc then
put rctxt;
run;
As a side note, if you need to get the files list but do not feel confident with the "DOPEN()"-family of functions , you can use the BasePlus SAS package and the %dirsAndFiles() macro to do the "give-me-the-list-of-files" job for you.
Bart
... View more