Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mf_mval.sas
Go to the documentation of this file.
1 /**
2  @file mf_mval.sas
3  @brief Returns a macro variable value if the variable exists
4  @details Use this macro to avoid repetitive use of `%if %symexist(MACVAR) %then`
5  type logic.
6  Usage:
7 
8  %if %mf_mval(maynotexist)=itdid %then %do;
9 
10  @version 9.2
11  @author Allan Bowe
12 **/
13 
14 %macro mf_mval(var);
15  %if %symexist(&var) %then %do;
16  %superq(&var)
17  %end;
18 %mend;