03-04-2017 05:21 PM
I would be very grateful if someone could please help me with the following query. I have a macro variable that contains a string, but the expression contains variable names. In the example below, the macro variable contains an expression that refers to variables 'a' and 'b'. The dataset 'testdata' contains these variables. I would like to know how to set 'c' to be the numeric result of evaluating the macro variable 'test', so should equal 3.
%Let test = "a+b";
03-04-2017 06:00 PM
Remove quotes from the %let statement.
Replace ??? In datastep with &c.
At its basics consider macro variables as a Find/Replace algorithm. The result needs to be valid SAS code.
Need further help from the community? Please ask a new question.