From: Espen on
I'm constructing a macro where I want a macro-variable in a text
string, but the macro does not recognize it. It looks like this:

%macro test (var);
(...)
if effect ne '&var.constant' then delete;
(...)
%mend;

the macro does not recognize &var.
Any suggestions? Thank you.
From: Tom Abernathy on
On May 10, 5:21 am, Espen <espe...(a)gmail.com> wrote:
> I'm constructing a macro where I want a macro-variable in a text
> string, but the macro does not recognize it. It looks like this:
>
> %macro test (var);
> (...)
> if effect ne '&var.constant' then delete;
> (...)
> %mend;
>
> the macro does not recognize &var.
> Any suggestions? Thank you.

SAS will not evaluate macro variable references inside of Single quote
characters use double quote characters.

if effect ne "&var.constant" then delete;