Thanks for your quick answer. The actual problem is to rename Cov1-Cov90 (output lsmeans) into Col1-Col90 (for use as coefficent matrix in proc mixed). As I need to run it several times, I don't want to specify the number of columns by hand, and it differs between the datasets. I found this other post, where it was possible in a macro, but also by specifying the number of columns by hand (like the first approach): https://communities.sas.com/t5/SAS-Enterprise-Guide/Rename-variables-using-a-loop-data-step/td-p/337185 If there is any replace method, all I need is to replace "Cov" by "Col". And yes, there are also other variables in the dataset, but my idea was to split these variables off, change their names and merge it again... I'm a bit surprised that this seems to be so difficult, as in R it's one line and done... Thanks again
... View more