SAS - Define and Run a Macro in RSUBMIT/ENDRSUBMIT

This post briefly shows how to define and run a given SAS macro with RSUBMIT/ENDRSUBMIT.


SAS MACRO in RSUBMIT/ENDRSUBMIT



Using RSUBMIT/ENDRSUBMIT commands, a remote server is executed not a local one and we can expect a huge reduced execution time.

RSUBMIT/ENDRSUBMIT should be placed at the top and bottom of the defining and running section of a macro respectively. In particular, if RSUBMIT/ENDRSUBMIT are included in the definition (body) of a macro, it sends errors and doesn't work.


Define a Macro


RSUBMIT
  %MACRO macro_name(args1, args2, ...);
   .....
  %MEND macro_name
ENDRSUBMIT


Run a Macro


RSUBMIT
  %macro_name(args1 = var1, args2 = var2, ...);
ENDRSUBMIT



Bottom LIne


Unlike a local mode, in a remote mode, RSUBMIT/ENDRSUBMIT should be placed at the top and bottom of the defining and running section of a macro respectively. \(\blacksquare\)


No comments:

Post a Comment