getchangeinfo.sas
Go to the documentation of this file.
1 /**
2  @file getchangeinfo.sas
3  @brief Returns the details for an approval diff
4  @details
5 
6  <h4> SAS Macros </h4>
7  @li mf_getengine.sas
8  @li mp_abort.sas
9  @li mpe_checkrestore.sas
10 
11  <h4> Service Inputs </h4>
12  <h5> sascontroltable </h5>
13  @li table table ID or LOAD_REF used to uniquely identify a staged change
14 
15  <h4> Service Outputs </h4>
16 
17  <h5> work.jsparams </h5>
18  Mainly sourced from MPE_SUBMIT plus some extra cols:
19 
20  @li LIB_ENGINE Library engine
21  @li allow_restore YES if a user can restore, else NO
22  @li REASON reason why a restore is / is no possible
23 
24  <h4> Data Inputs </h4>
25  @li MPE_AUDIT
26  @li MPE_COLUMN_LEVEL_SECURITY
27  @li MPE_ROW_LEVEL_SECURITY
28  @li MPE_SUBMIT
29 
30  @version 9.2
31  @author 4GL Apps Ltd
32  @copyright 4GL Apps Ltd. This code may only be used within Data Controller
33  and may not be re-distributed or re-sold without the express permission of
34  4GL Apps Ltd.
35 
36 **/
37 
38 %mpeinit()
39 
40 %let table=;
41 data _null_;
42  set SASControlTable;
43  call symputx('table',table);
44 run;
45 
46 data APPROVE1;
47  set &mpelib..mpe_submit
48  (rename=(SUBMITTED_ON_DTTM=submitted_on REVIEWED_ON_DTTM=REVIEWED_ON));
49  where TABLE_ID="&TABLE";
50  TABLE_NM=cats(base_lib,'.',base_ds);
51  BASE_TABLE=table_nm;
52  call symputx('base_lib',base_lib);
53  REVIEWED_ON_DTTM=put(reviewed_on,datetime19.);
54  SUBMITTED_ON_DTTM=put(submitted_on,datetime19.);
55 run;
56 
57 /**
58  * Check if user has basic access permission to RESTORE the table
59  */
60 %put checking access;
61 %global allow_restore reason;
62 %mpe_checkrestore(&table,outresult=ALLOW_RESTORE,outreason=REASON)
63 
64 data work.jsParams;
65  set approve1;
66  LIB_ENGINE="%mf_getEngine(&base_lib)";
67  allow_restore="&allow_restore";
68  REASON="&reason";
69 run;
70 
71 %mp_abort(iftrue= (&syscc ne 0)
72  ,mac=&_program..sas
73  ,msg=%str(syscc=&syscc)
74 )
75 
76 %webout(OPEN)
77 %webout(OBJ,jsParams)
78 %webout(CLOSE)
79 
80 
81 %mpeterm()