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
5 Use this macro to avoid repetitive use of `%if %symexist(MACVAR) %then`
6 type logic.
7 Usage:
8
9 %if %mf_mval(maynotexist)=itdid %then %do;
10
11 @version 9.2
12 @author Allan Bowe
13**/
14
15%macro mf_mval(var);
16 %if %symexist(&var) %then %do;
17 %superq(&var)
18 %end;
19%mend mf_mval;