Also note, macro language merely substitutes for &VAR to generate a SAS language statement. Your SAS program includes:
if yes = 'yes' then set lib1.base_1;
Hopefully, if you saw this statement in your program you would realize that it does the wrong thing. (This also explains why SAS sees the need to create a variable named YES.)
The solutions already suggested are best. But recognize that you could also get the right result (but at the cost of a longer-running program) by adding double quotes:
if "&var" = 'yes' then set lib1.base_1;
This would generate a clumsy but workable program containing:
if "yes" = 'yes' then set lib1.base_1;
... View more