Purpose:
Reverse a macro variable's value.
Notes:
For versions before v6.12. Otherwise use%sysfunc(reverse(&<macro-variable>))
%sysfunc(reverse(&<macro-variable>))
%macro reverse (string); %local i rstring; %let rstring=; %let string=%quote(&string); %do i=%length(&string) %to 1 %by -1;%quote(%substr(&string,&i,1))%end; %mend;