02-14-2017 07:23 PM
Can someone explain why the macro %DOIT
%macro abc; *%put in abc; %mend abc; %macro doit; *%abc %put here; *%let x = %abc; %put value of x is &x; %mend doit; %doit * run doit;
here in abc value of x is *
Why is the first call to %ABC is commented, while the %PUT and %LET statements aren't?
02-14-2017 10:26 PM
I don't know. It's always confused me and it always stuffs things up. That's why I use '/* … */' for my macro comments. And when I need to comment them out, because they don't cascade, I put
%macro comment; … … %mend comment;
around blocks of code.
I know it doesn't answer your question, which is a good one, but sometimes life's too short.
02-15-2017 04:06 AM
Looks to me like Macro calls are not executed in an asterisk style comment, but macro statements are executed. As the second macro call is part of a macro statement (%let), it is executed and yields a single asterisk.