mpe_column_level_security_postedit.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Post Edit Hook script for the MPE_COLUMN_LEVEL_SECURITY table
4  @details Post edit hooks provide additional backend validation for user
5  provided data. The incoming dataset is named `work.staging_ds` and is
6  provided in mpe_loader.sas.
7 
8  Available macro variables:
9  @li DC_LIBREF - The DC control library
10  @li LIBREF - The library of the dataset being edited (is assigned)
11  @li DS - The dataset being edited
12 
13  This validation checks the incoming column_level_security settings to ensure
14  each individual filter is valid
15 
16 
17 **/
18 
19 /* check scope values and ensure uppercasing */
20 %let errflag=0;
21 %let errmsg=;
22 data work.staging_ds;
23  set work.staging_ds;
24  cls_scope=upcase(cls_scope);
25  CLS_LIBREF=upcase(CLS_LIBREF);
26  cls_table=upcase(CLS_TABLE);
27  CLS_VARIABLE_NM=upcase(CLS_VARIABLE_NM);
28 
29  if cls_scope not in ('ALL','VIEW','EDIT') then do;
30  call symputx('errflag',1);
31  call symputx('errmsg',"Invalid scope: "!!cls_scope);
32  stop;
33  end;
34 
35  if cls_hide<1 then cls_hide=0;
36  else cls_hide=1;
37  if CLS_ACTIVE<1 then CLS_ACTIVE=0;
38  else CLS_ACTIVE=1;
39 
40 run;
41 
42 %mp_abort(iftrue=(&errflag=1)
43  ,mac=mpe_column_level_security_postedit
44  ,msg=%superq(errmsg)
45 )