mpe_getgroups.sas
Go to the documentation of this file.
1 /**
2  @file mpe_getgroups.sas
3  @brief Gets groups from metadata and augments with DC groups
4  @details Fetches groups using relevant logic (Viya, EBI, Base) and augments
5  with the contents of the MPE_GROUPS table.
6 
7  %mpe_getgroups(user=&user,outds=work.usergroups)
8 
9  <h4> SAS Macros </h4>
10  @li dc_getusergroups.sas
11 
12  @version 9.3
13  @author 4GL Apps Ltd
14  @copyright 4GL Apps Ltd. This code may only be used within Data Controller
15  and may not be re-distributed or re-sold without the express permission of
16  4GL Apps Ltd.
17 **/
18 
19 %macro mpe_getgroups(user=,outds=);
20 
21  %if not %symexist(dc_repo_users) %then %let dc_repo_users=foundation;
22 
23  %dc_getusergroups(user=&user,outds=&outds)
24 
25  data;
26  length groupname groupdesc $256;
27  set &dc_libref..mpe_groups;
28  where &dc_dttmtfmt. lt tx_to;
29  where also upcase(user_name)="%upcase(&user)";
30  groupname=group_name;
31  groupdesc=group_desc;
32  keep groupname groupdesc;
33  run;
34 
35  data &outds;
36  set &syslast &outds(keep=groupname groupdesc);
37  run;
38 
39 %mend mpe_getgroups;