dc_getsettings.sas
Go to the documentation of this file.
1 /**
2  @file dc_getsettings.sas
3  @brief Get settings
4  @details There are two versions of this macro - a META and a VIYA version (in
5  different folders). The interfaces is the same. This version is VIYA.
6 
7  <h4> SAS Macros </h4>
8  @li mp_abort.sas
9  @li mf_getapploc.sas
10 
11  @version 3.5
12  @author 4GL Apps Ltd
13  @copyright 4GL Apps Ltd. This code may only be used within Data Controller
14  and may not be re-distributed or re-sold without the express permission of
15  4GL Apps Ltd.
16 **/
17 
18 %macro dc_getsettings();
19 %global DC_LIBNAME DC_LIBREF;
20 
21 %if %symexist(_PROGRAM) %then %let root=&_program;
22 %else %do;
23  %global _metauser;
24  %let _metauser=&sysuserid;
25  /* to mimic a "real" _program we need to give a dummy role and stp name */
26  %let root=/dummyRole/dummyName;
27 %end;
28 
29 
30 /* the DC precode is stored in the Admin folder in the root of
31  the project. Lets find that root. */
32 %put &=root;
33 %let root=%mf_getapploc();
34 %put &=root;
35 
36 /* Now we know the root location we can retrieve the params */
37 /* only do this if the lib is not assigned - this is an expensive Viya call */
38 
39 %if x&dc_libref.x=xx %then %do;
40  %put fetching settings from API - this is an expensive call;
41  %put it is recommended to put these values in the autoexec;
42  filename __dc filesrvc folderpath="&root/services";
43  %inc __dc(settings)/source2;
44 %end;
45 
46 
47 %let DC_LIBNAME=&dc_libref;
48 %let mpelib=&DC_LIBREF;
49 
50 %mp_abort(iftrue= (&syscc ne 0)
51  ,mac=&_program
52  ,msg=%str(Problem running &sysmacroname (&syswarningtext &syserrortext))
53 )
54 
55 %mend dc_getsettings;