I am not sure whether you understand this or not. but i tried my level best.... proc sql noprint; select quote(trim(name)) into :names separated by ',' from dictionary.columns where libname='WORK' AND memname='B'; In above code you are storing all name column values into a macro variable with "," separator.. (the names will stores in this macro variable like this.."aaa,bbb,ccc,ddd".) create table temp as select * from renames where original in (&names); In above you are creating a temp dataset and here you are putting a condition where original values in names(name macro variable having all the name value in B data set). select catx('=',original,newname) into :rename separated by ' ' from temp; Here you are creating another macro variable with name called "rename" and you are storing "original=newname" value into that macro variable. (the value will stores like this.."aaa=aaa1,bbb=bbb1...so on" proc datasets nolist lib=work; modify b ; rename &rename; run; quit; Here you are changing all the b data set name by using "rename" macro. Thank you.. Sanjeev
... View more