Hi Experts, I am trying to rename a bunch of old variables as Y1, Y2, Y3, …. but running into trouble. See code below. Any help would be greatly appreciated. Thanks Harrison: %let varlist= A0A075B6K4 A0A075B6K5 A2NJV5 O14562 O96009 P00390 P01742 P01834 P01892 P02655 P02751 P02765 P02786 P02787 P02790 P09467 P11686 P16152 P18065 P20039 P30405 P30838 P35247 P43652 P49006 P50238 P61326 P63151 P02768_1 P06681_1 P14678_1 P22897_1 P23246_1 P29279_1 P51159_1 P61201_1 Q02790 Q02818 Q03252 Q14956 Q16401 Q99758 Q7Z2W4 Q8IWL2_1 Q8N9N7 Q96AG4 Q96IU4 Q96PD5 Q96S96 Q9BPX5 Q9BQ61 Q9BUL8 Q9BWS9_1 Q9H1Z4 Q9NQ79 Q9P2T1_1 Q9UGT4 Q9Y3E1; data _null_; length old $32 rename $4; do i=1 to countw("&varlist"); old=scan("&varlist",i); rename &old = Y&i; end; call symputx('rename',rename); run;
... View more