diff --git a/sas/sasjs/macros/mpe_makedata.sas b/sas/sasjs/macros/mpe_makedata.sas index 528e36f..9c8c988 100644 --- a/sas/sasjs/macros/mpe_makedata.sas +++ b/sas/sasjs/macros/mpe_makedata.sas @@ -1866,6 +1866,15 @@ insert into &lib..MPE_VALIDATIONS set ,rule_value='0' ,rule_active=1 ,tx_to='31DEC5999:23:59:59'dt; +insert into &lib..MPE_VALIDATIONS set + tx_from=0 + ,base_lib="&lib" + ,base_ds="MPE_ROW_LEVEL_SECURITY" + ,base_col="RLS_SUBGROUP_ID" + ,rule_type='NOTNULL' + ,rule_value='0' + ,rule_active=1 + ,tx_to='31DEC5999:23:59:59'dt; insert into &lib..MPE_VALIDATIONS set tx_from=0 ,base_lib="&lib" diff --git a/sas/sasjs/sasjsconfig.json b/sas/sasjs/sasjsconfig.json index 25c4030..a703fe1 100644 --- a/sas/sasjs/sasjsconfig.json +++ b/sas/sasjs/sasjsconfig.json @@ -124,7 +124,8 @@ "serviceFolders": [ "sasjs/targets/viya/services_viya/viya_users", "sasjs/targets/viya/services_viya/admin", - "sasjs/targets/viya/services_viya/public" + "sasjs/targets/viya/services_viya/public", + "sasjs/targets/viya/services_viya/validations" ], "initProgram": "sasjs/utils/serviceinitviya.sas", "termProgram": "", diff --git a/sas/sasjs/services/admin/demodata.sas b/sas/sasjs/services/admin/demodata.sas index b89b3ea..3bf1b32 100644 --- a/sas/sasjs/services/admin/demodata.sas +++ b/sas/sasjs/services/admin/demodata.sas @@ -122,10 +122,16 @@ run; table.tableExists result=r2 / name="COUNTRIES" caslib="PUBLIC"; if r2.exists then table.dropTable / name="COUNTRIES" caslib="PUBLIC" quiet=TRUE; + + table.tableExists result=r2 / name="MPE_AUDIT" caslib="PUBLIC"; + if r2.exists then + table.dropTable / name="MPE_AUDIT" caslib="PUBLIC" quiet=TRUE; quit; proc casutil; load data=work.CARS_EXT outcaslib="PUBLIC" casout="CARS_EXT" promote; load data=work.COUNTRIES outcaslib="PUBLIC" casout="COUNTRIES" promote; + load data=&dc_libref..MPE_AUDIT + outcaslib="PUBLIC" casout="MPE_AUDIT" promote; run; data &joblib..JOBDATA; set work.JOBDATA;run; %end; diff --git a/sas/sasjs/services/validations/tables_all.sas b/sas/sasjs/services/validations/tables_all.sas index 2272dd4..55c84d7 100644 --- a/sas/sasjs/services/validations/tables_all.sas +++ b/sas/sasjs/services/validations/tables_all.sas @@ -54,7 +54,7 @@ %let vartgtlib=%mf_getuniquename(); %let var_is_lib=%mf_getuniquename(); data _null_; - length &varlibds $41 &vartgtlib $8 libref $8 rls_libref $8; + length &varlibds $41 &vartgtlib $8 libref $8 rls_libref cls_libref $8; if _n_=1 then call missing(of _all_); set work.source_row; &varlibds=upcase(symget('libds')); diff --git a/sas/sasjs/targets/viya/services_viya/validations/sas_groups.sas b/sas/sasjs/targets/viya/services_viya/validations/sas_groups.sas new file mode 100644 index 0000000..5cb9080 --- /dev/null +++ b/sas/sasjs/targets/viya/services_viya/validations/sas_groups.sas @@ -0,0 +1,61 @@ +/** + @file + @brief validating the mpe_security.sas_group column + @details The input table is simply one row from the target table in table + called "work.source_row". + + Available macro variables: + @li LIBDS - The library.dataset being filtered + @li VARIABLE_NM - The column being filtered + + +

Service Outputs

+ The values provided below are generic samples - we encourage you to replace + these with realistic values in your own deployments. + +
DYNAMIC_VALUES
+ The RAW_VALUE column may be charactor or numeric. If DISPLAY_INDEX is not + provided, it is added automatically. + + |DISPLAY_INDEX:best.|DISPLAY_VALUE:$|RAW_VALUE| + |---|---|---| + |1|$77.43|77.43| + |2|$88.43|88.43| + +
DYNAMIC_EXTENDED_VALUES
+ This table is optional. If provided, it will map the DISPLAY_INDEX from the + DYNAMIC_VALUES table to additional column/value pairs, that will be used to + populate dropdowns for _other_ cells in the _same_ row. + + Should be used sparingly! The use of large tables here can slow down the + browser. + + |DISPLAY_INDEX:best.|EXTRA_COL_NAME:$32.|DISPLAY_VALUE:$|DISPLAY_TYPE:$1.|RAW_VALUE_NUM|RAW_VALUE_CHAR:$5000| + |---|---|---| + |1|DISCOUNT_RT|"50%"|N|0.5|| + |1|DISCOUNT_RT|"40%"|N|0.4|| + |1|DISCOUNT_RT|"30%"|N|0.3|| + |1|CURRENCY_SYMBOL|"GBP"|C||"GBP"| + |1|CURRENCY_SYMBOL|"RSD"|C||"RSD"| + |2|DISCOUNT_RT|"50%"|N|0.5|| + |2|DISCOUNT_RT|"40%"|N|0.4|| + |2|CURRENCY_SYMBOL|"EUR"|C||"EUR"| + |2|CURRENCY_SYMBOL|"HKD"|C||"HKD"| + + + +

SAS Macros

+ @li dc_getgroups.sas + + +**/ + + +%dc_getgroups(outds=groups) + +proc sql; +create table work.DYNAMIC_VALUES as + select distinct groupname as display_value, + groupuri as raw_value + from work.groups + order by 1;