Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mf_existfeature.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Checks whether a feature exists
4 @details Check to see if a feature is supported in your environment.
5 Run without arguments to see a list of detectable features.
6 Note - this list is based on known versions of SAS rather than
7 actual feature detection, as that is tricky / impossible to do
8 without generating errors in most cases.
9
10 %put %mf_existfeature(PROCLUA);
11
12 @param feature the feature to detect. Leave blank to list all in log.
13
14 @return output returns 1 or 0 (or -1 if not found)
15
16 <h4> SAS Macros </h4>
17 @li mf_getplatform.sas
18
19
20 @version 8
21 @author Allan Bowe
22**/
23/** @cond */
24
25%macro mf_existfeature(feature
26)/*/STORE SOURCE*/;
27 %let feature=%upcase(&feature);
28 %local platform;
29 %let platform=%mf_getplatform();
30
31 %if &feature= %then %do;
32 %put Supported features: PROCLUA;
33 %end;
34 %else %if &feature=PROCLUA %then %do;
35 /* https://blogs.sas.com/content/sasdummy/2015/08/03/using-lua-within-your-sas-programs */
36 %if &platform=SASVIYA %then 1;
37 %else %if "&sysver"="9.2" or "&sysver"="9.3" %then 0;
38 %else %if "&SYSVLONG" < "9.04.01M3" %then 0;
39 %else 1;
40 %end;
41 %else %do;
42 -1
43 %put &sysmacroname: &feature not found;
44 %end;
45%mend mf_existfeature;
46
47/** @endcond */