Loading...
Searching...
No Matches
mpe_checkrestore.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mpe_checkrestore macro
4 @details Checking functionality of mpe_checkrestore.sas macro
5
6 <h4> SAS Macros </h4>
7 @li dc_getsettings.sas
8 @li mpe_checkrestore.sas
9 @li mp_assert.sas
10 @li mp_assertscope.sas
11 @li mp_testservice.sas
12
13
14 @author 4GL Apps Ltd
15 @copyright 4GL Apps Ltd. This code may only be used within Data Controller
16 and may not be re-distributed or re-sold without the express permission of
17 4GL Apps Ltd.
18
19**/
20
21/* first, run a data update */
22%mp_testservice(&appLoc/tests/services/auditors/postdata.test.1,
23 viyacontext=&defaultcontext
24)
25
26/* now grab the latest update */
27%let loadref=0;
28data APPROVE1;
29 set &mpelib..mpe_submit end=last;
30 if last then call symputx('loadref',table_id);
31run;
32
33%global dc_repo_users dc_macros dc_libref dc_staging_area dc_admin_group
34 mpelib dc_dttmtfmt;
35%dc_getsettings()
36
37%put checking it is restorable;
38%global allow_restore reason;
39%mp_assertscope(SNAPSHOT)
40%mpe_checkrestore(&loadref,outresult=ALLOW_RESTORE,outreason=REASON)
41%mp_assertscope(COMPARE,
42 desc=Checking macro variables against previous snapshot,
43 ignorelist=ALLOW_RESTORE REASON
44 MCLIB0_JADP1LEN MCLIB0_JADP2LEN MCLIB0_JADPNUM MCLIB0_JADVLEN
45 MCLIB2_JADP1LEN MCLIB2_JADP2LEN MCLIB2_JADPNUM MCLIB2_JADVLEN
46)
47
48%mp_assert(
49 iftrue=(&syscc=0),
50 desc=Checking successful submission
51)
52%mp_assert(
53 iftrue=(&ALLOW_RESTORE=YES),
54 desc=Checking restoring is possible
55)
56%mp_assert(
57 iftrue=(&REASON=IS ADMIN),
58 desc=Checking reason code returned
59)