Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mf_getplatform.sas
Go to the documentation of this file.
1 /**
2  @file mf_getplatform.sas
3  @brief Returns platform specific variables
4  @details Enables platform specific variables to be returned
5 
6  %put %mf_getplatform();
7 
8  returns:
9  SASMETA (or SASVIYA)
10 
11  @param switch the param for which to return a platform specific variable
12 
13  <h4> Dependencies </h4>
14  @li mf_mval.sas
15  @li mf_trimstr.sas
16 
17  @version 9.4 / 3.4
18  @author Allan Bowe
19 **/
20 
21 %macro mf_getplatform(switch
22 )/*/STORE SOURCE*/;
23 %local a b c;
24 %if &switch.NONE=NONE %then %do;
25  %if %symexist(sysprocessmode) %then %do;
26  %if "&sysprocessmode"="SAS Object Server"
27  or "&sysprocessmode"= "SAS Compute Server" %then %do;
28  SASVIYA
29  %end;
30  %else %if "&sysprocessmode"="SAS Stored Process Server" %then %do;
31  SASMETA
32  %return;
33  %end;
34  %else %do;
35  SAS
36  %return;
37  %end;
38  %end;
39  %else %if %symexist(_metaport) %then %do;
40  SASMETA
41  %return;
42  %end;
43  %else %do;
44  SAS
45  %return;
46  %end;
47 %end;
48 %else %if &switch=SASSTUDIO %then %do;
49  /* return the version of SAS Studio else 0 */
50  %if %mf_mval(_CLIENTAPP)=%str(SAS Studio) %then %do;
51  %let a=%mf_mval(_CLIENTVERSION);
52  %let b=%scan(&a,1,.);
53  %if %eval(&b >2) %then %do;
54  &b
55  %end;
56  %else 0;
57  %end;
58  %else 0;
59 %end;
60 %else %if &switch=VIYARESTAPI %then %do;
61  %mf_trimstr(%sysfunc(getoption(servicesbaseurl)),/)
62 %end;
63 %mend;