validatefilter.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Validates a filter clause before it gets hashified, returns the RK
4  @details Used to generate a FILTER_RK from an input query dataset.
5  Raw values are stored in dc.mpe_filtersource and the meta values are stored
6  in dc.mpe_filteranytable
7 
8  <h4> Service Inputs </h4>
9  <h5> IWANT </h5>
10  |FILTER_TABLE:$41.|
11  |---|
12  |DC258467.MPE_X_TEST|
13 
14  <h5> FILTERQUERY </h5>
15  |GROUP_LOGIC:$3|SUBGROUP_LOGIC:$3|SUBGROUP_ID:8.|VARIABLE_NM:$32|OPERATOR_NM:$10|RAW_VALUE:$32767|
16  |---|---|---|---|---|---|
17  |AND|AND|1|SOME_BESTNUM|>|1|
18  |AND|AND|1|SOME_TIME|=|77333|
19 
20  <h4> Service Outputs </h4>
21 
22  <h5> result </h5>
23  @li FILTER_HASH
24  @li FILTER_RK
25  @li FILTER_TABLE
26 
27  <h4> SAS Macros </h4>
28  @li dc_assignlib.sas
29  @li mf_getvalue.sas
30  @li mp_filterstore.sas
31  @li removecolsfromwork.sas
32 
33  @version 9.2
34  @author 4GL Apps Ltd
35  @copyright 4GL Apps Ltd. This code may only be used within Data Controller
36  and may not be re-distributed or re-sold without the express permission of
37  4GL Apps Ltd.
38 
39 **/
40 
41 %mpeinit()
42 
43 %let ds=%upcase(%mf_getvalue(work.iwant,filter_table));
44 %dc_assignlib(WRITE,%scan(&ds,1,.))
45 
46 %mp_filterstore(
47  libds=&ds,
48  queryds=work.filterquery,
49  filter_summary=&dc_libref..mpe_filteranytable,
50  filter_detail=&dc_libref..mpe_filtersource,
51  lock_table=&dc_libref..mpe_lockanytable,
52  maxkeytable=&dc_libref..mpe_maxkeyvalues,
53  outresult=work.result,
54  outquery=work.query, /* not used */
55  mdebug=1
56 )
57 
58 %removecolsfromwork(___TMP___MD5)
59 
60 proc sql;
61 alter table work.result drop PROCESSED_DTTM;
62 
63 %webout(OPEN)
64 %webout(OBJ,result)
65 %webout(CLOSE)
66 
67 %mpeterm()