In SAS/IML is it possible to change a variable if only a macro with its name is available? Using symget on left side produces mistake:
proc iml;
variable = 0;
call symput ('macVar', 'variable');
/* &macVar = 1;*/
symget('macVar') = 1;
print variable;
quit;
ERROR 180-322: Statement is not valid or it is used out of proper order.
The &-sign works, but the code is in a do-loop and symget must be used.
The problem stems from task to write a function that accepts variable number of arguments and processes them in several do-loops. It is connected with the following questions:
SAS IML use of Mattrib with Macro (symget) in a loop
SAS IML pass reference to variable defined in macro
In other languages (R, C++, Java, Matlab, etc..) the task is solved with help of abstraction.
Ideas?
SOLVED
Thanks a lot. Useful article.