viewtables.test.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief testing public/viewtables service
4 
5  <h4> SAS Macros </h4>
6  @li dc_refreshcatalog.sas
7  @li mf_getengine.sas
8  @li mp_assert.sas
9  @li mp_assertdsobs.sas
10  @li mx_testservice.sas
11 
12  <h4> Related Programs </h4>
13  @li viewtables.sas
14 
15 **/
16 
17 %let _program=&appLoc/services/public/viewtables;
18 
19 /* ensure catalog is up to date */
20 %dc_refreshcatalog(DCTEST)
21 
22 data work.sascontroltable;
23  mplib="DCTEST";
24 run;
25 
26 %mx_testservice(&_program,
27  viyacontext=&defaultcontext,
28  inputdatasets=work.sascontroltable,
29  outlib=web1,
30  mdebug=&sasjs_mdebug
31 )
32 data work.mptables;
33  set web1.mptables;
34  putlog (_all_)(=);
35 run;
36 
37 %mp_assertdsobs(work.mptables,
38  desc=DCTEST contains tables,
39  test=ATLEAST 2
40 )
41 
42 %let engine=0;
43 data work.libinfo;
44  set web1.libinfo;
45  putlog (_all_)(=);
46  call symputx('engine',engine);
47 run;
48 
49 %mp_assertdsobs(work.libinfo,
50  desc=LIBINFO contains one row,
51  test=EQUALS 1
52 )
53 %mp_assert(
54  iftrue=(&engine=%mf_getengine(DCTEST)),
55  desc=Checking returned engine matches the one we put in
56 )
57 
58 
59 %let catcnt=0;
60 proc sql noprint;
61 select count(*) into: catcnt
62  from work.mptables
63  where substr(reverse(cats(upcase(memname))),1,3)='CF-';
64 
65 %mp_assert(
66  iftrue=(&catcnt=1),
67  desc=Checking dclib cat was created
68 )
69 
70 
71