Macros for SAS Application Developers
https://github.com/sasjs/core
mp_jsonout.test.1.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing mp_jsonout.sas macro
4 
5  <h4> SAS Macros </h4>
6  @li mp_jsonout.sas
7  @li mp_assert.sas
8 
9 **/
10 
11 filename webref temp;
12 
13 data demo;
14  dtval=date();
15  format dtval date9.;
16  compare=put(date(),date9.);
17  call symputx('compare',compare);
18 run;
19 
20 %mp_jsonout(OPEN,jref=webref)
21 %mp_jsonout(OBJ,demo,jref=webref,fmt=Y)
22 %mp_jsonout(CLOSE,jref=webref)
23 
24 data _null_;
25  infile webref;
26  input;
27  putlog _infile_;
28 run;
29 
30 libname web JSON fileref=webref;
31 %let dtval=0;
32 data work.test;
33  set web.demo;
34  call symputx('dtval',dtval);
35 run;
36 
37 %mp_assert(
38  iftrue=(&syscc=0),
39  desc=Checking for error condition,
40  outds=work.test_results
41 )
42 
43 %mp_assert(
44  iftrue=(&dtval=&compare),
45  desc=Checking tables were created successfully,
46  outds=work.test_results
47 )