DATA Step, Macro, Functions and more

resolve a macro variable within a comment

Reply
New Contributor
Posts: 3

resolve a macro variable within a comment

I would like to resolve a macro variable within a comment:

 

*xxx yyy &MACVAR zzz;

 

Is this possible?

Super User
Posts: 5,518

Re: resolve a macro variable within a comment

No, but if you just want to see it in the log, you replace the comment with:

 

%put xxx yyy &MACVAR zzz;

Super User
Super User
Posts: 7,083

Re: resolve a macro variable within a comment

[ Edited ]

Use %UNQUOTE().

%macro test(comment);
* First comment ;
%unquote(* &comment) ;
proc print data=sashelp.class; run;
%mend test;

options mprint;
%test(Hi there);

MPRINT(TEST):   * First comment ;
MPRINT(TEST):   * Hi there ;
MPRINT(TEST):   proc print data=sashelp.class;
MPRINT(TEST):   run;
Ask a Question
Discussion stats
  • 2 replies
  • 164 views
  • 0 likes
  • 3 in conversation