Loading...
Searching...
No Matches
tables_all.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Generic validator for tables in a library
4 @details The input table is simply one row from the target table in table
5 called "work.source_row".
6
7 Available macro variables:
8 @li MPELIB - The DC control library
9 @li LIBDS - The library.dataset being filtered
10 @li VARIABLE_NM - The column being filtered
11
12
13 <h4> Service Outputs </h4>
14 The values provided below are generic samples - we encourage you to replace
15 these with realistic values in your own deployments.
16
17 <h5>DYNAMIC_VALUES</h5>
18 The RAW_VALUE column may be charactor or numeric. If DISPLAY_INDEX is not
19 provided, it is added automatically.
20
21 |DISPLAY_INDEX:best.|RAW_VALUE|
22 |---|---|---|
23 |1|77.43|
24 |2|88.43|
25
26 <h5>DYNAMIC_EXTENDED_VALUES</h5>
27 This table is optional. If provided, it will map the DISPLAY_INDEX from the
28 DYNAMIC_VALUES table to additional column/value pairs, that will be used to
29 populate dropdowns for _other_ cells in the _same_ row.
30
31 Should be used sparingly! The use of large tables here can slow down the
32 browser.
33
34 |DISPLAY_INDEX:best.|EXTRA_COL_NAME:$32.|DISPLAY_TYPE:$1.|RAW_VALUE_NUM|RAW_VALUE_CHAR:$5000|
35 |---|---|---|---|---|
36 |1|DISCOUNT_RT|N|0.5||
37 |1|DISCOUNT_RT|N|0.4||
38 |1|DISCOUNT_RT|N|0.3||
39 |1|CURRENCY_SYMBOL|C||"GBP"|
40 |1|CURRENCY_SYMBOL|C||"RSD"|
41 |2|DISCOUNT_RT|N|0.5||
42 |2|DISCOUNT_RT|N|0.4||
43 |2|CURRENCY_SYMBOL|C||"EUR"|
44 |2|CURRENCY_SYMBOL|C||"HKD"|
45
46 <h4> SAS Macros </h4>
47 @li dc_assignlib.sas
48 @li mf_getuniquename.sas
49 @li mp_abort.sas
50
51 @sasjslint {"maxLineLength": 95}
52
53**/
54
55/* send back the raw and formatted values */
56%let tgtlib=0;
57%let varlibds=%mf_getuniquename();
58%let vartgtlib=%mf_getuniquename();
59%let var_is_lib=%mf_getuniquename();
60data _null_;
61 length &varlibds $41 &vartgtlib $8 libref $8 rls_libref cls_libref $8;
62 if _n_=1 then call missing(of _all_);
63 set work.source_row;
64 &varlibds=upcase(symget('libds'));
65 if &varlibds="&mpelib..MPE_TABLES" then &vartgtlib=LIBREF;
66 else if &varlibds="&mpelib..MPE_ROW_LEVEL_SECURITY"
67 then &vartgtlib=RLS_LIBREF;
68 else if &varlibds="&mpelib..MPE_COLUMN_LEVEL_SECURITY"
69 then &vartgtlib=CLS_LIBREF;
70
71 /* validate name */
72 if nvalid(&vartgtlib,'v7') then call symputx('tgtlib',&vartgtlib);
73 call symputx('vartgtlib',&vartgtlib);
74
75 putlog (_all_)(=);
76run;
77
78%mp_abort(iftrue= ("&tgtlib" ="0" )
79 ,mac=&_program..sas
80 ,msg=%str(Invalid library - %superq(vartgtlib))
81 ,errds=work.dc_error_response
82)
83
84%dc_assignlib(READ,&tgtlib)
85
86data members; /* empty table */
87name=' ';
88run;
89ods output Members=Members;
90proc datasets library=&tgtlib ;
91run;
92
93/* send back the raw and formatted values */
94proc sql;
95create table work.DYNAMIC_VALUES as
96 select distinct upcase(name) as raw_value
97 from work.members
98 where MemType='DATA'
99 order by 1;
100