![]() |
PING
0.9
Statistical data handling and processing in production environment
|
Verify the existence of a given macro by searching into the set of pre-compiled macros as well as the content of all autocall libraries.
macro_name : name of the macro to check the existence of; the macro may already be compiled or would be brought in via autocall.
_ans_ : name of the variable storing the result of the test, e.g.:
%macro_name is found in the catalog macros compiled for the current session (e.g., catalog WORK.SASMACR or WORK.SASMAC1, see note below),WORK.MSTORE),SASAUTOS),%macro_exist is an adaptation of S. Bass's original %execute_macro.sas macro, so as to keep only the existence testing. Original source code (no disclaimer) is available at https://github.com/scottbass/SAS/blob/master/Macro/execute_macro.sas.%sysmacexist checks for the existence of a macro in WORK.SASMACR and SOURCE.SASMACR only. However, on Linux, esp. in EG, compiled macros are saved to WORK.SASMAC1 instead of WORK.SASMACR. For SAS versions prior to 9.3, we implemented our own search macro (see reference 3 below).%macro_exists.sas macro that searches for pre-compiled macros and all autocall libraries.