Type : SASHELP
Uses the sashelp.vfunc system view to check for the function's existence.
| 1 | %macro mf_existfunction(name)/*/STORE SOURCE*/; |
| 2 | |
| 3 | %local dsid rc exist; |
| 4 | %let dsid=%sysfunc(open(sashelp.vfunc(where=(fncname="%upcase(&name)")))); |
| 5 | %let exist=1; |
| 6 | %let exist=%sysfunc(fetch(&dsid, NOSET)); |
| 7 | %let rc=%sysfunc(close(&dsid)); |
| 8 | |
| 9 | %sysevalf(0 = &exist) |
| 10 | |
| 11 | %mend mf_existfunction; |