data _null_;
set new_names end=last;
if _n_=1 then do;
call execute("proc datasets library=work;
modify ttt;
rename");
end;
call execute (oldname||'='||newname);
if last then call execute(';quit;');
run;
You may want to consider searching the forum. This sort of question has been asked and answered a number of times.