I want to do the following request :
data _null_;
call symputx("test",findw(' x y z ','x'));
run;
using a macrovariable instead of the
' x y z '
part, i.e.
data _null_;
call symputx("test",findw(&mv,'x'));
run;
where mv is a macrovariable, whose value is calculated by a macro-function that I can't modify. Let's assume that this value is :
%let mv=x y z;
My problem is that if mv does not contain quotation marks, the code won't work :
ERROR 388-185: Expecting an arithmetic operator.
I tried to add them using %str
(again, I can't modify the way mv is calculated so I have to use &mv
):
%let mv2=%str(%') &mv %str(%');
and using %put
, I can see that mv2 value is 'x y z'
But I get a similar error as before (not quite the same):
ERROR 386-185: Expecting an arithmetic expression.
If y try with %let mv=' x y z ';
, it works but I can't do such a thing as I have to use &mv
(or can I ?).
I don't understand what's wrong, what should I do ?