Loading...
Searching...
No Matches
getddl.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief testing getddl service
4
5 <h4> SAS Macros </h4>
6 @li mp_assertdsobs.sas
7 @li mx_execute.sas
8
9 @sasjslint {"maxLineLength": 86}
10
11**/
12
13
14%let _program=&appLoc/services/public/getddl;
15
16/* test 1 */
17data work.params;
18 length name $32 value $1000;
19 name='libref';value="&dclib";output;
20 name='ds';value='MPE_TABLES';output;
21 name='flavour';value='TSQL';output;
22run;
23%mx_execute(&_program,
24 viyacontext=&defaultcontext,
25 inputparams=work.params,
26 outref=webout,
27 viyaresult=WEBOUT_TXT,
28 mdebug=&sasjs_mdebug
29)
30
31data work.results;
32 infile webout;
33 input;
34 putlog _infile_;
35 if _n_=2 then do;
36 if _infile_=:'/* TSQL Flavour DDL for' and index(_infile_,'MPE_TABLES')>0 then do;
37 putlog 'test passed';
38 output;
39 output;
40 end;
41 stop;
42 end;
43 else if _n_>2 then stop;
44run;
45
46%mp_assertdsobs(work.results,
47 desc=DDL file is successfully returned for a table,
48 test=EQUALS 2,
49 outds=work.test_results
50)
51
52/* test 2 - format catalog */
53data work.params;
54 length name $32 value $1000;
55 name='libref';value="DCTEST";output;
56 name='ds';value='DCFMTS-FC';output;
57run;
58%mx_execute(&_program,
59 viyacontext=&defaultcontext,
60 inputparams=work.params,
61 outref=web2,
62 viyaresult=WEBOUT_TXT,
63 mdebug=&sasjs_mdebug
64)
65
66data work.results2;
67 infile web2;
68 input;
69 putlog _infile_;
70 if index(upcase(_infile_),'WORK.FMTEXTRACT') then do;
71 putlog 'test passed';
72 output;
73 output;
74 stop;
75 end;
76 else if _n_>50 then stop;
77run;
78
79%mp_assertdsobs(work.results2,
80 desc=DDL file is successfully returned from format catalog,
81 test=EQUALS 2,
82 outds=work.test_results
83)