tables_editable.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Generic validator for editable libraries
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  <h4> Service Inputs </h4>
13  <h5> work.source_row</h5>
14  |libref:$8|
15  |somelib|
16 
17  <h4> Service Outputs </h4>
18  The values provided below are generic samples - we encourage you to replace
19  these with realistic values in your own deployments.
20 
21  <h5>DYNAMIC_VALUES</h5>
22  The RAW_VALUE column may be charactor or numeric. If DISPLAY_INDEX is not
23  provided, it is added automatically.
24 
25  |DISPLAY_INDEX:best.|DISPLAY_VALUE:$|RAW_VALUE|
26  |---|---|---|
27  |1|$77.43|77.43|
28  |2|$88.43|88.43|
29 
30  <h5>DYNAMIC_EXTENDED_VALUES</h5>
31  This table is optional. If provided, it will map the DISPLAY_INDEX from the
32  DYNAMIC_VALUES table to additional column/value pairs, that will be used to
33  populate dropdowns for _other_ cells in the _same_ row.
34 
35  Should be used sparingly! The use of large tables here can slow down the
36  browser.
37 
38  |DISPLAY_INDEX:best.|EXTRA_COL_NAME:$32.|DISPLAY_VALUE:$|DISPLAY_TYPE:$1.|RAW_VALUE_NUM|RAW_VALUE_CHAR:$5000|
39  |---|---|---|---|---|---|
40  |1|DISCOUNT_RT|"50%"|N|0.5|` `|
41  |1|DISCOUNT_RT|"40%"|N|0.4|` `|
42  |1|DISCOUNT_RT|"30%"|N|0.3|` `|
43  |1|CURRENCY_SYMBOL|"GBP"|C|` `|"GBP"|
44  |1|CURRENCY_SYMBOL|"RSD"|C|` `|"RSD"|
45  |2|DISCOUNT_RT|"50%"|N|0.5|` `|
46  |2|DISCOUNT_RT|"40%"|N|0.4|` `|
47  |2|CURRENCY_SYMBOL|"EUR"|C|` `|"EUR"|
48  |2|CURRENCY_SYMBOL|"HKD"|C|` `|"HKD"|
49 
50 **/
51 
52 /* send back the raw and formatted values */
53 data _null_;
54  var=symget('variable_nm');
55  libds=symget('libds');
56  if libds="&mpelib..MPE_EXCEL_CONFIG" and var='XL_TABLE' then do;
57  call symputx('srccol','XL_LIBREF');
58  end;
59  else call symputx('srccol','libref');
60 run;
61 
62 proc sql;
63 create table work.DYNAMIC_VALUES as
64  select distinct dsn as display_value,
65  upcase(dsn) as raw_value
66  from &mpelib..mpe_tables
67  (where=(&dc_dttmtfmt. < tx_to))
68  where libref in (select &srccol from work.source_row)
69  order by 1;
70