In reply to Leonid Batkhan.

Hi Leonid,

Sorry for late reply, but I forgot about this thread :-)

I think I would remove brackets with %qsubstr(...) and %sysfunc(reverse(...)), like:

%macro test(x, y);
%put &=x &=y;
%let z = %qsysfunc(reverse(%qsubstr(%qsysfunc(reverse(%qsubstr(&x.,2))),2)));
%put &=z;
%mend test;

%test((a, b, c), 17)

But if &x. will be submitted to %qscan(...) function we don't have to remove brackets, since %qscan(...) would ignore "blank" argument before the first and after the last delimiter, like:

%macro test2(x, y);
%put &=x &=y;
%do i = 1 %to %qsysfunc(countw(&x.,%str((,))));
%let a = %unquote(%qscan(&x., &i., %str((,))));
%put &=i *&=a*;
%end;
%mend test2;

%test2((a, b, c), 17)

All the best
Bart