So the %LEFT() function is found and working fine.
The other issue is that sometimes inside a macro when you use macro code to generate a single token, in this case the token TEST3, the parser can get confused and see it as two tokens. So instead of coding:
set test1 - test%left(&num.);
You can either build up the token first and then use it.
%let last =test%left(&num.);
set test1 - &last;
Or add something that lets the parser see it as one token.
set test1 - %unquote(test%left(&num.));
You can also just use a simple %LET to remove the spaces from NUM.
%let num=#
set test1-test#
But the real solution is to not put the spaces into the macro variable to begin with.
select count(*) into :num trimmed from t_test where prxmatch('/^test/io',strip(memname));
...
set test1-test&num ;
... View more