Hi all,
Can someone explain how does recursive macros work. As of my understanding a macro has to be defined before calling it so, how can we call a macro without defining it
Regards
Solo
During definition of a macro, no other macros are called, only the call statements are compiled. The call happens when the macro is executed, so you can have recursion.
During definition of a macro, no other macros are called, only the call statements are compiled. The call happens when the macro is executed, so you can have recursion.
It is in the execution that recursion would occur. You always have to have defined the macro before you can execute it.
Remember that the name space for macros is flat. At any point in time there can only be one definition for macro X. So there is no nesting of macro definitions (recursive or not). The nesting occurs when the macros execute.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.