DATA Step, Macro, Functions and more

Executing SAS Macros based on Macro variables

Reply
N/A
Posts: 1

Executing SAS Macros based on Macro variables

Hi,

I need to execute macros dynamically, by reading the macro name from a macro variable.

Essentially i would want to do th ebelow

%(&macro_name);

where the macro name will be passed at run time to decide which macro to be executed.

Can this be done?

Super User
Posts: 5,077

Re: Executing SAS Macros based on Macro variables

Yes, just lose the parentheses:

%&macro_name

Ask a Question
Discussion stats
  • 1 reply
  • 171 views
  • 1 like
  • 2 in conversation